Issue to solve. I will get a new HA instance, just a small setup on a RPI. It will be behind a double NAT with no public internet address. It will have a few sensors I would like to propagate to my main HA instance.
My idea was to use MQTT Statestream on the remote HA and using exclude/include to control the few sensor I would like to replicate to the main HA.
It look super simple in the documentation. However, I have got a initial problem.
For MQTT Statestream to work it needs a MQTT integration on the remote HA. When I setup this, I point it to the Mosquitto broker on my main instance (easy now as they are on same network, will solve the security part later).
When I do this, it will discover all the Z2M and HAAS agent devices, which was not the intention, as I only setup MQTT integration for MQTT Statestream to send statechanges for a few sensorsâŚ
The solution should be to disable âdiscoveryâ on the MQTT integration, however I can not figure out to do this during initial setup. The possibility does not show during initial setup by the GUI, only later in the configuration. At this time all the MQTT devices are already discovered, and they are not removed again when I chose âdo not discoverâ. They show up, however is not actually working.
Im also in doubt about the base tropic, should I leave this as âhomeassistantâ
I have been looking for examples for MQTT Statestream, however not found any good examples in the community forum.
I have looked at remote HA. Problem for âremote HAâ is the way the connection is created. The âhostâ is initiating the connection and not the remote HA. As I cannot get to the remote HA from outside (there is no IP address), this is not an option.
This is why statestream seems better, as the remote devices are initiating the TCP connection.
An alternative I can look into is creating a VPN with a WLAN, However seem a lot of work for something small.
How did you setup the MQTT integration on the HA instance. I read it as a pre requisite, for statestream to workâŚ
When I setup MQTT integration, it discovers all devices from the MQTT Broker. I would like to avoid the secondary HA instance have the devices detected. Did you do something special?
my 2 cents in this discussion:
Until april 2024, i was using REMOTE-HA integration to connect a master HA instance and a slave one.
Since Core-2024.4.x calling a remote script makes the script runs several times⌠(and itâs random ! not each timeâŚ). Restoring Core-2024.3.x solved the problem.
I made a post on the dev github page of remote-ha but for sure i wonât get any answer⌠looks like itâs not maintained anymore
So iâm in the process of migrating from remote-ha to MQTT with statestream and also with MQTT Sensor and Switch integrations.
About 80% already done
I found that for some specific switches (GPIO 2 special relay circuit on the slave instance that only accepts an âonâ event to trigger and automaticaly comes back to âoffâ), i had to use the exact same topic for the command and the state otherwise the relay is triggered with a simple topic refresh⌠(sometime a simple ha reboot has caused a trigger) Just because with the classic â2 topicsâ; one for command and the other for state, the command stays âonâ while the topic is well returned to âoffââŚ
Using the same topic for both, makes (of course) the command return to âoffâ and does not trigger accidentaly anymore
Before MQTT was moved to UI setup it was possible to configure MQTT without discovery being enabled. Since the move to UI setup you have to disable discovery after setup. The only way around this that I found was to initially connect to a âdummyâ MQTT server and then point to the correct server as part of reconfiguration.
It is a pain and you should really be able to disable discovery as part of the Initial UI setup process.