I had some problems with MQTT, but got it working with your pointers.
But now I have the following, I’m getting info from my smart meter and this info is send every 10 seconds. ONLY, when a sensor is not used in that 10 seconds (gas for instance), the sensor disappears from Hassio (checked “<>”) and Lovelace looks like this: https://imgur.com/Wz49N9t
Is there a way to maintain the last value from the sensor, because now it doesn’t look that nice…
I will tell you what I’ve got. Don’t know if it is correct or maybe “over done”, but it work so I don’t want to mess with it (Or someone here can tell that something is not necessary).
Ok, so I have two RPI, one is my Master and the other is just for sending data from my smart meter (Gas and electricity incl. solar numbers).
On MASTER:
Installed add-on “Mosquitto broker” with this config:
Install “Integration” “MQTT: Mosquitto Broker” (And here I don’t know if this is correct or that this is double). Can’t see what I’ve written down but I think I gave an username and password here.
In configuration.yaml
mqtt_eventstream:
subscribe_topic: slavetopic
And that’s it! Basically what happens (I think) is that when a value in SLAVE is changed the automation will make sure it is send through MQTT. And in MASTER it is said they want to use this sensor reading (point 4)
Hope this helps, otherwise give me another message.
Hey @Eltjo_de_Waard massive thankyou for taking the time to write such a detailed reply.
I was hoping that eventstream would work without having to define every sensor in the configuration.yaml and write automations to post the sensor updates (as it currently sort of does, but then the sensors keep disappearing!) - so I think your solution is probably the only way to get this working properly.
Thankyou for this, I will give this a try and report back!
It uses the combination of MQTT Statestream to exchange entity states, between server/client (master/slave) instances of Home Assistant plus MQTT Discovery to automatically create the entities on the client (slave) instance of Home Assistant.
There’s also a custom component called home-assistant-remote . It uses Websockets instead of MQTT to create a bi-directional connection between two instances of Home Assistant.
Thankyou too @123 ! I shall try this in the first instance, and see if it does the job. I do need to be able to turn the slave switches on and off from the master instance, so this could be ideal.
Such a great help on these forums, cheers!
I failed! I couldn’t get home assistant remote to do anything, and with the other mqtt method, the automations that guy used created tens of copies of each of my sensors and ground both master and slave to a halt. I really wish it weren’t so tricky to link 2 instances of HA - i heard there was a method using node-red but I can’t find it.