Hi
I’m trying to do something when I get mqtt json (keypad zigbee2mqtt json).
this is the a sample json
{ "action": "disarm", "action_code": "3333", "action_transaction": 65, "action_zone": 23, "battery": 100, "battery_low": false, "contact": true, "last_seen": "2022-12-16T21:53:21+02:00", "linkquality": 135, "occupancy": true, "presence": null, "tamper": true, "temperature": 22, "voltage": 6100}
I want the automation to trigger if
action = disarm and action_code = “3333”
When trying it in template I get True for this
{{value_json.action_code == '3333' and value_josn.action == 'disarm'}}```
and also for this
{% if value_json.action_code == '3333' and value_josn.action == 'disarm' %}
True
{% else %}
False
{% endif %}
But when I added it to an automation trigger is doesn’t work
platform: mqtt
topic: zigbee2mqtt/LrKeypad
value_template: "{{value_json.action_code == '3333' and value_josn.action == 'disarm'}}"
Thanks