Displaying status of door sensor

Hello all :slight_smile:

Just about to give up after spending a couple of days trying to get what seems like a simple thing to work - with no success.

The problem is that I just want do display the status of a door sensor in HA. I have flashed Sonoff Bridge with Tasmota, and are picking up the sensors codes all right both in the Tasmota console and in Node-Red - but I just can’t figure out how to display if a door is open or close in Home Assistant/LoveLace! Nothing fancy - just a simple icon or plain text telling if a door is open or not.

I feel I’ve tried everything, but with no luck.

How do I solve this simple task?

PS: I’m still just a newbee so please explain in easy steps :slight_smile:

This is my config:

binary_sensor:
  - platform: mqtt
    state_topic: "tele/RF_Bridge/RESULT"
    name: 'Altandør'
    value_template: '{{value_json.RfReceived.Data}}'
    payload_on: "5951AE"
    payload_off: "5951A7"
    device_class: Door
    qos: 1

Does this config work? I mean, if you go to Developer Tools -> States, do you see binary_sensor.altandor or something similar?

Yes. Actually I have three of them (because failing to get them to work so many times).
None of them seems to work as both dont react to the sensor.

Can you please show the payload?

Have you got any other working device using MQTT ?

This?

4.2.2020, 20:15:02node: c619d65.d483428
tasmota/tele/RESULT : msg.payload : string[109]
"{"Time":"2020-02-04T20:14:59","RfReceived":{"Sync":9470,"Low":330,"High":960,"Data":"5951AE","RfKey":"None"}}"

No - these sensors is the first ones I try with MQTT. The brand is Kerui.

Perhaps obvious but is your Mqtt config correct in configuration.yaml

And is the rfbridge connected to Hass

Using the dev-mqtt can you subscribe to your rfbridge and see anything

Did you add your mqtt credentials to the bridge?

1 Like

This is a different topic than the one in your config, shouldn’t it be the same?

Hm. not sure how to check if MQTT is correctly installed, but I can see the sensors sending in console, if that’s what you mean (remenber: I’m a newbee :slight_smile: )

… and then I can pick it up with Node-Red using the sensor-node:

Ok so I don’t use node red but just to be sure this is how it works.

You need to have an mqtt broker installed. Usually mosquito
Then you add it to ha in the configuration.yaml. Have a look in integrations mqtt

Then those credentials need to be added in tasmota, in the mqtt section.

Wow!!! You’re right! When I changed the topic, it worked!!!

Incredible!

Lesson learned: Don’t copy everything from a Youtube-tutorial without thinking :slight_smile:

Thank you SO much!

A suggestion, don’t use Youtube videos, reddit or anything else, apart from the official documentation. In case the documentation is insufficient, come here to ask for help.

Will remember that.
I should have done it 2 days ago, but I felt I was to much of a newbee to ask a question so simple like this.

Just starting out with home automation, and this is was the first thing after lights - which I have got to work perfectly. Still ALOT to learn, and to be honest, I find many tutorials almost impossible to understand, and some of the documentation seems outdated. That makes it very hard to walk the first steps for us newbees.

:slight_smile:

The documentation is the most up-to-date resource of information you can get for non-coders. Can you please point me to the parts that seem outdated? I can take a look and maybe edit it.

1 Like

I went down a similar rabbit hole when I started. The topic gets switched around when you set tasmota to autodiscover. If you turn autodiscover off, it doesn’t change back the topic.