Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enhancement: Include homie-convention such that openHAB MQTT 2.4 Binding can auto-discover the Sensors #57

Closed
chiefymuc opened this issue Nov 12, 2018 · 6 comments

Comments

@chiefymuc
Copy link

Just an idea for easier use. If the device "announces" itself according to the complete homie convention, then the new MQTT Binding in openHAB would auto-discover it.

@ThomDietrich
Copy link
Owner

Not just an idea, this is definitely something that is going to happen 😃
The daemon already supports an earlier version of the convention and as one of the authors of the convention, I am of course highly motivated to update it to comply with the latest revision. Time is sparse right now but I'll look into the adoption in the next couple of days.

@pavax
Copy link

pavax commented Jan 6, 2019

I was playing around a little bit to publish the sensor data according to the homie 3.0 convention.

see here: https://github.com/pavax/miflora-mqtt-daemon/blob/master/miflora-mqtt-daemon.py

Pay attention to the fact, that openhab 2.4 does not support '-' within the device-id's name or apparently has some issues with it (see: eclipse-archived/smarthome#6784). So make sure you change that value in the config.ini:

homie_device_id = miflora

@Markkuuss
Copy link
Contributor

Pay attention to the fact, that openhab 2.4 does not support '-' within the device-id's name. So make sure you change that value in the config.ini:

homie_device_id = miflora

Do you use the embedded MQTT Broker from OpenHab 2.4?

Don't you have a problem with #55?

@pavax
Copy link

pavax commented Jan 6, 2019

@Markkuuss I'm using mosquitte so there was no need to set the client_id as mentioned in #55.

@chrostek
Copy link
Contributor

@pavax your code works for me with the latest openHAB 2.5.5 (and mosquitto)
but i think it would be better when the firmware gets moved in the sensors, because it could be that not all sensors have the same firmware version. any chance that you make a pull request?

@chrostek
Copy link
Contributor

chrostek commented May 19, 2020

Ich erlaube mir mal in Deutsch zu schreiben, mein Englisch ist nicht so gut :-)
Ich hab selbst einen Pull-Request #119 gemacht auf Basis der Arbeit von @pavax und doch völlig anders.
Um auch das hier homieiot/convention#136 angesprochene Problem sauber zu lösen und es in openHAB auch sauber dargestellt zu haben (ein Thing pro Sensor), habe ich eine MQTT Client Connection pro Sensor gemacht. Dadurch kann ich Firmware und Co. pro Sensor übermitteln und auch einen Last Will pro Sensor. Ich habe das auch noch soweit ergänzt, dass der state bei einem Fehler auf disconnected geht und einen Timestamp wie in #50 habe ich auch ergänzt - aber alles nur für homie.
Ich hoffe, dass es euch zusagt - es ist ein recht großer Umbau und ist nicht mehr kompatibel zum alten Homie Code - entspricht aber meiner Ansicht nach so der v3.0 Convention.

Wie seht ihr das?

So sieht das ganze aus, dem Sensor vom Elefantenbaum habe ich absichtlich die Batterie entnommen, damit man sieht, dass dieser in openHAB auch sauber als Offline angezeigt wird:

image

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants