magcode / mpower-tools

Tools for operating Ubiquiti Networks mPower devices
Apache License 2.0
60 stars 46 forks source link

Added handling for 'online' Homie property #8

Closed bgould closed 6 years ago

bgould commented 6 years ago

According to the spec this is supposed to be the last property sent after the device is configured and other properties are published. Added 'online = true' to mqpub-static.sh after other properties have been published. Additionally, added a LWT message to the mqsub script so that when mosquitto_sub disconnects, 'online = false' is automatically published on the broker. In the future, might want to consider sending 'online = true' every time port statuses are published, and might also want to consider sending 'online = false' in mqstop.sh

BTW @magcode your project is very useful, thank you for sharing it

magcode commented 6 years ago

Thank you very much @bgould Will test it asap and merge afterwards.

Soon there will be homie mqtt support in openhab (incl. discovery). Once that is available I'll probably tune the homie stuff a bit.