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

Trigger an automation using type MQTT

$
0
0

Hi! I’m unable to make this work… I have a zigbee doorlock in zigbee2mqtt. I want to trigger an automation when a specific user id unlock the door. It was working flawless with ZHA using zha_event but now that I’ve moved to Z2M, I’m unable to make this work with the trigger type MQTT. If anyone could give me hint/help that would be really appreciated!

Here’s the output of mosquitto_sub when I unlock the door with the user, as you can see the important part for me here is “action_user”:6 and the topic is "zigbee2mqtt/mqtt doorlock "

zigbee2mqtt/mqtt doorlock {"action":"unlock","action_source":0,"action_source_name":"keypad","action_user":6,"auto_relock_time":0,"battery":96,"linkquality":72,"lock_state":"unlocked","state":"UNLOCK","voltage":5600}
zigbee2mqtt/mqtt doorlock {"action":"","auto_relock_time":0,"battery":96,"linkquality":72,"lock_state":"unlocked","state":"UNLOCK","voltage":5600}
zigbee2mqtt/mqtt doorlock/action unlock

I’ve played with different combination of this automation without any luck, the trigger just doesn’t work…

alias: Unlock notification - UserX
description: ''
trigger:
  - platform: mqtt
    topic: zigbee2mqtt/mqtt_doorlock
condition:
  - condition: template
    value_template: '{{ action_user == 6 }}'
action:
  - service: notify.mobile_app_cell
    data:
      message: Code 6 unlocked the door
      title: Code 6 unlocked the door
      data:
        ttl: 0
        priority: high
mode: single

I’ve read the documentation (MQTT Device Trigger - Home Assistant) but can’t see what I’m missing…

1 post - 1 participant

Read full topic


Viewing all articles
Browse latest Browse all 105842

Trending Articles



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