HA Master/Slave with MQTT Statestream and Discovery

Inspired by JamesMcCarthy79’s awesome Lovelace setup, I’ve been adding a bunch of sensors for things on my network, and some of them I’m needing to use a scrape sensor, like information from my cable modem. Since you never seem to get a scrape sensor right the first few times, and I hate restarting HA over and over, interrupting zwave, etc, I turned up another instance to test the scrape sensors first.
Then I thought, why not just leave them there and use mqtt_statestream to share them back to my main instance? This worked OK, except every time I add a sensor, I need to add an mqtt sensor on the main instance and restart anyway. So I looked at mqtt_eventstream and played with it, but it does not seem to do what I was wanting (I honestly can’t figure out how it works, it almost seems opposite of what I thought.)
My next thought was, since I was using MQTT discovery on my main instance for Tasmota and zigbee2mqtt, to share them that way. It seems to work OK, except I have to manually send a config to get them recognized initially, and if I restart my main instance, I have to send the config topics again.
Has anyone else played with this, or am I making it more difficult than I need to? My next thought was to have an automation that is triggered via MQTT from the hass/status topic sent for zigbee2mqtt to make my HA sensor instance send off the config topics, I just haven’t quite figured it out yet. Does the MQTT integration keep the sensors (for instance Tasmota or zigbee2mqtt devices,) through a restart? I did try one with a uniq_id but it showed up as an orphan _2 entity without a device.

Thanks,
Denny

This may interest you:

1 Like

Interesting. Thanks!