Quantcast
Channel: Configuration - Home Assistant Community
Viewing all articles
Browse latest Browse all 102782

Adding a MQTT doorbell to my configuration.yaml file - What am I doing wrong?

$
0
0

Hello HA Community!

I’ve managed to get my doorbell to publish mqtt events to the Mosquitto broker installed in my HA instance but I’m having trouble creating the binary sensor to state change on those incoming mqtt events.

My goal is that when the doorbell rings I can trigger an automation to play a sound on several smart speakers.

This is the event that the doorbell emits when someone rings the bell:

{
    "Action": "Start",
    "Code": "CallNoAnswered",
    "Data": {
        "CallID": "8",
        "LocaleTime": "2022-04-28 10:21:55",
        "UTC": 1651170115.0
    },
    "Index": 0,
    "serialNumber": "LNWZ6C34FA0F941"
}

And this is the binary sensor create that I’ve added to my configuration.yaml file which isn’t working:

binary_sensor:
  - platform: mqtt
    name: "Doorbell Button State"
    state_topic: "DahuaVTO/CallNoAnswered/Event"
    availability_topic: "DahuaVTO/CallNoAnswered/Event"
    value_template: "{{ 'ON' if value_json.Action == 'Start' else 'OFF' }}"

The resulting binary sensor has failed to pick up any state changes:
Overview_–_Home_Assistant

Thanks for any help!

1 post - 1 participant

Read full topic


Viewing all articles
Browse latest Browse all 102782

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>