Trying to setup MQTT door bell

Hi all,

Need a little help with getting my doorbell to work with HA.

So once I subscribe to the topic in the config file I see the output in the HA debug log -

2020-10-27 21:43:40 DEBUG (MainThread) [homeassistant.components.mqtt] Received message on rflink/Aster-00f4: b'{"SWITCH":"01","CMD":"ON","SWITCH01":"ON"}'

/config/configuration.yaml

sensor:
  - platform: mqtt
    name: "doorbell"
    state_topic: "rflink/Aster-00f4"

I created automation but it doesn’t get triggered

/config/automations.yaml

#################################################################
## Doorbell automation
#################################################################

- alias: Doorbell ringing
  trigger:
    platform: mqtt
    topic: rflink/Aster-00f4
    payload: 'SWITCH":"01","CMD":"ON","SWITCH01":"ON'
  action:
    - service: notify.pushover
      data:
        title: "There is someone at the door!"
        message: "Doorbell!!!"

i also set the payload to “ON” but that didn’t work either

does anyone have any ideas?

Thanks :slight_smile:

still stuck with this :frowning:

It looks like your mqtt payload data is coming in json format. Probably worth having a look at this thread…How to get value from mqtt json to mqtt sensor?

You’ll probably have to create a json template for it to work.

1 Like

Thanks for the reply.

I see so I should be doing something along the line of

  - platform: mqtt
    name: "doorbell CMD"
    state_topic: "rflink/Aster-00f4"
    unit_of_measurement: ""
    value_template: "{{ value.json.CMD }}"

in HA log I see “2020-11-15 18:50:42 DEBUG (MainThread) [homeassistant.components.mqtt] Received message on rflink/Aster-00f4: b’{“SWITCH”:“01”,“CMD”:“ON”,“SWITCH01”:“ON”}’”

but if I view the sensor under dev tools it’s state still shows unknown