MQTT State Stream Help

On my main instance I have a mosquitto mqtt server running.

On my remote instance I setup mqtt statestream and which publishes to that server, the screen shot below shows the state stream publishing to the MQTT server on my main instance.

I can’t seem to pull the values from the MQTT server into sensors on the main instance. Below is the config in my sensor.yaml on the main instance.

  - platform: mqtt
    state_topic: "remote/sensor/dht_sensor_temperature/state"
    name: "Temperature"
    unit_of_measurement: "°F"

  - platform: mqtt
    state_topic: "remote/sensor/dht_sensor_humidity/state"
    name: "Humidity"
    unit_of_measurement: "%"

Below is a screen shot of a check of the state stream using remote/#. Seems like I have everything right, what am I not setting up right?

Mine look like this…

- platform: mqtt
  state_topic: 'stat/MQTTOSSensor/OSTemp'
  name: 'OS Sensor Temp'
  unit_of_measurement: '°C'
  value_template: '{{ value_json.OSTemp }}'
1 Like

Only difference I see is the value template, which I don’t think I need as the MQTT value is just the value not in JSON.

Do the MQTT sensors show up at all? Are the sensors missing or are they showing up but not reading values?

1 Like

They show up as sensors in the main instance but are not pulling the values. Both are reporting “unknown”

No errors in the log either, forgot to mention that.

So this was either an issue of “double quotes” vs. ‘single quote’ around the state topic

or

I had the client_id in the main MQTT setup the same on both instances.

those changes and a restart on both pi’s and I am up in running.

That will be the problem.

hi,

Im just getting to know mqtt_streams a bit, and am trying to set it up to show the stream in a separate Card in the frontend. Would this be possible?
I have only this in my configuration file since i want to read all state changes, and don’t want to clutter for now with attributes and timestamps :

mqtt_statestream:
  base_topic: homeassistant
  publish_attributes: false
  publish_timestamps: false

Thanks for any help,
Marius