First a disclaimer, I have no hands-on experience with MQTT Statestream. What I’m about to share is based on my interpretation of the documentation.
It publishes all of Home Assistants events as MQTT topics. So if some component changes state, it gets published.
If your use-case is just one sensor then Statestream is the proverbial A-bomb to kill a fly. You don’t need Home Assistant publishing state-changes for all components just for one sensor. For one sensor, I’d probably investigate using an automation to publish the sensor’s state-changes to an MQTT topic. Have the other instance of Home Assistant subscribed to the topic (i.e. the other instance uses an MQTT Sensor).
Oh the other hand, if you want to subscribe to state-changes for all components than Statestream is probably the way to go.
FWIW, I’ve been using another Home Automation software since 2008 (Premise Home Control; development for it ended in 2006). It works great, I know it inside out, and have written several drivers for it. However, its frontend is based on antiquated technologies and its user-base is now microscopically small. So I developed the equivalent of MQTT Statestream for it. Home Assistant is subscribed to all of Premise’s topics and now serves as the frontend.
I recently added the Homekit component and it was a treat to have Siri activate a UPB light, controlled by Premise, all through the magic of the component and MQTT (miracle glue for Home Automation).
I’ve read the documentation, but for me it’s not clear. Off topic, I think a lot of the documentation will benefit if there were realistic examples.
In my use-case it states one sensor, but that’s for the example. I’m getting a P1 cable to get data from my smart meter (electricity and gas), so the number of data will increase. But that would cloud the example (I think )
Its pretty easy…
I configured a Mosquitto instance and have three Hass instances. In every instance I wrote in config:
mqtt:
broker: <IP of Mosquitto (in my case equal to my main Hass instance)>
port: 1883
client_id: <UNIQUE_NAME>
keepalive: 60
mqtt_statestream:
base_topic: <UNIQUE_NAME>
For the main pi you have to have MQTT setup, the statestream MQTT events should then automatically setup a sensor - look in <> to find it, it should have the same entity id as the remote pi. At least that’s my memory of how to set it up ymmv.
I’ve read your replies to the explanations provided to you in this thread and in the one you created in r/homeassistant. I believe your confusion is due to unfamiliarity with MQTT.
I highly recommend you read HiveMQ’s MQTT Essentials. It helped me gain a better understanding of the subject matter.
MQTT Statestream isn’t at all complicated to configure and use but not having an understanding of MQTT can certainly make it seem complicated. If terms like topics, root topic, publishing, subscribing, retain, qos, etc are unclear then do yourself a favor and read MQTT Essentials (or some other introductory reference).
I’m afraid you’re correct. Since I need it for a one time job I was hoping to get it done with some trial and error… will read the MQTT Essentials and try again
If for some reason I won’t get it to work, are you then willing to help me out?
which works fine (creating a device_tracker in the slave didn’t btw…)
hoping that using state stream allows for not having to create automations for each device_tracker…
I can confirm all topics are created and I can see them in the Mqtt inspector (FX in my case), but, I am afraid I can only create sensors of these? I would have hoped to create device_trackers though, so please have a thought about that
@Mariusthvdb why don’t you just use the restful sensor to pull sensor state from remote instances? Or better yet use Node-RED I don’t even bother with statestream any more as Node-RED can be the bridge required. I run 3 main instances and another 3 slaves and Node-RED handles the interaction between them.