Hi everyone, I’ve got a question.
I have a Sonoff SNZB-01 switch paired with a Sonoff bridge with the Tasmota firmware.
In HA/Mosquita I can see these messages coming in when I press the button of the switch:
{
“ZbReceived”: {
“0x237C”: {
“Device”: “0x237C”,
“Name”: " Deurbel",
“0006!02”: “”,
“Power”: 2,
“Endpoint”: 1,
“LinkQuality”: 92
}
}
}
I want to create an automation that filters the single press of the button. There will be more buttons with different automations. .In configuration.yaml I have this:
mqtt:
#Deurbel
sensor:
name: “Deurbel”
state_topic: “tele/zigbee-bridge/SENSOR”
value_template: “{{ value_json.ZbReceived[0].0x237C.Name “Deurbel” }}”
In my automation I have this:
alias: Deurbel
description: “”
trigger:
- platform: mqtt
topic: tele/zigbee-bridge/SENSOR
condition: - condition: template
value_template: "{{ value_json.ZbReceived[0].0x237C.Name }} "
action: - service: notify.paul_s_devices
data:
message: “1”
mode: single
I don’t understand how to set a condition on a nested MQTT message. Can someone explain this to me or point me in the right direction. It would be a big help to me.
Thanks!