monitor
monitor copied to clipboard
[feature request] Support HA MQTT Discovery
Hi! Great tool! Just starting to use it.
It would be awesome if you could support HA MQTT Discovery, as outlined here: https://www.home-assistant.io/docs/mqtt/discovery/
I've been working on this, especially since the setup for HA's growing userbase is becoming too complex.
I agree, this feature would be awesome, have you got any update?
This would be really nice! It seems like if some of the info that is already collected could be directed to a separate topic that could then be referenced as a discovery topic in HA it might "just work" ... is there anything we could do to help you out on this @andrewjfreyer ?
@genebean Not sure if this helps: I'm currently working on a Node Red Flow to add HA MQTT discovery as well as some other additional logic on top of monitor.sh. Inspired by Monitor-Appdaemon-App I started to create this because: a) Node Red & MQTT are the backbone of all my automations (I hate YAML automations) b) I'm not using App Daemon at all and I want to avoid the use of to many technologies
It's still work in progress, no documentation available at the moment and I'm sure there are a lot of bugs in it, but current features are:
- configuration of user/device mapping using a JSON structure
- registration if known_static_devices with each monitor.sh instance (thx to @andrewjfreyer MQTT command to support this)
- binary sensor indicating presence for each device incl. MQTT Discovery
- sensors that report monitor.sh confidence for each device at each location (essentially this is onyl MQTT discovery, state msgs are coming from monitor.sh anyway)
- binary sensor indicating presence for each configured user incl. MQTT Discovery (based in device assigments)
- binary sensors for everyone_home, everyone_not_home, somebody_is_home incl. MQTT Discovery
- trigger of arrival/departure scans by MQTT messages (e.g. from motion sensors)
If you are interested I can share the flow with you.
Thanks @CaCu15! I’m happy to check it out. Any chance what you’re doing would help with #375? My monitor.sh is in my office and MQTT is at home (the two are linked via ZeroTier). Sometimes the link between them drops and I’d like to be able to have Node-RED trigger updating HA with the current state of affairs.
@genebean: I need to fix some bugs & write some documentation, then I can provide the flow in a repo. Hope I can finish this during the next week.
Concerning #375: Sending monitor.sh an MQTT message to the topic monitor/scan/KNOWN DEVICE STATES triggers a reporting for all known devices from all monitor.sh instances. This works for me. So it should be easy to use something like this node https://flows.nodered.org/node/node-red-contrib-mqtt-connection-check to trigger an update messages for all devices if MQTT become available again.
I could send messages with the current state of each device from the node red flow as well (I'm keeping track of the state there), but because the communication of the node red flow with monitor.sh is based on MQTT as well this information will be outdated if the MQTT communication is not working.