Read the statement by Michael Teeuw here.
MMM-HomeAssistant
-
Hello,
After configuring my MagicMirror frame, I realized there is no straightforward module to establish a good connection with Home Assistant using its available features. Please take a look at the module I have been working on recently:
https://github.com/ambarusa/MMM-HomeAssistant
This module makes the MagicMirror available as an MQTT device automatically in Home Assistant, with the browser/monitor as a light entity, modules as switch entities, and sensors connected via GPIO as sensor entities. Everything happens through MQTT Autodiscovery, without needing to touch any configuration files in Home Assistant. This is what I really missed in other solutions like MMM-MQTTBridge.
Once connected, the possibilities for automations are endless and can be managed in the same place as other home automations. Once the GPIO pins are read and published, toggling the screen based on motion can be triggered from the central server, and this information can be used for other triggers in the house. This is what MMM-PIR is lacking.
So please have a look, give feedbacks and have fun with it!!
-
@adamambarus AWESOME… been looking for this myself…
I have done similar with a diff mirror platform…I have one problem with mine, when the mqtt server goes down, the connection is not restarted as expected… and the devices in HA are marked as not available
-
@sdetweil Hm great idea! I will investigate what happens with my module in that case, and come up with a handling for it!
-
@adamambarus I have mqtt server in a compose stack with watchtower and it gets upgraded on version updates…
also that machine is on UPS that just recently died after 8 years during a 15 second power outage… so mqtt went away for a LONG time… (I was out of town)
way longer than its reconnect timeout.
I see client is 5.13.0 now, I am using 5.1.3 on this client (last PR on mqtt for this reconnect problem seems to be 5.5.6 SO… maybe
https://github.com/mqttjs/MQTT.js/issues/1727
) -
@adamambarus Nice! Don’t forget to add it to the module list: https://github.com/MagicMirrorOrg/MagicMirror/wiki/3rd-party-modules :-)
-
@sdetweil
Hi, I just ran a few tests and the module can automatically reconnect if the server reappears. It is handled automatically in the mqtt lib, my part was to stop flooding the MM logs with mqtt error messages.
Give this module a try if you are interested, I would really appreciate other good findings. -
@KristjanESPERANTO Thanks! I am interested in that, I just don’t know how to do that :D Never changed other repos other than mine ever.
-
@adamambarus you edit this wiki page to add your module entry
https://github.com/MagicMirrorOrg/MagicMirror/wiki/3rd-Party-Modules#module-creators -
@sdetweil Hahh, of course how could I not see that button…
-
@adamambarus great… now, suddenly (been running for near 2 years) MY mqtt server cannot be reached from outside the docker host… SO much fun…