MySensors MQTT gateway not seeing new sensors

When I configure my MySensors Gateway as an Ethernet gateway, and configure HASS in the same way, everything works fine.

However, if I change my MySensors gateway to be an MQTT gateway, the sensors never show up in HASS. I can see the topics being published to using an MQTT client. My HASS configuration looks like this:

mysensors:
gateways:
- device: mqtt
persistence_file: ‘/home/hass/.homeassistant/mysensors.json’
topic_in_prefix: ‘mysensors-in’
topic_out_prefix: ‘mysensors-out’
debug: true
optimistic: false
persistence: true
retain: true
version: 2.0

What did I do wrong?

i have really no clue about MQTT but i think that we should call @martinhjelmare to the rescue :wink:

Have you also configured the mqtt component in home assistant?

You should also check the topic prefixes. The topic where the gateway publishes should go to topic_in_prefix and the gateway’s subscribe topic should go to topic_out_prefix. If you didn’t change the prefixes when writing the mqtt gateway sketch, the prefixes should be configured like this:

topic_in_prefix: 'mygateway1-out'
topic_out_prefix: 'mygateway1-in'

But check how you have setup your gateway sketch.

Ah ha! I didn’t realize the out_prefix was supposed to point to the “in” topic, and vice versa. I’ll give that a shot. Thank you!

1 Like