Why does "device" in automation work, but not with call service? short examples below

First one dosen’t work. But when i do same with “device” it works

Lock is connected with Zigbee via ZHA

alias: Lock test
description: ""
trigger:
  - platform: tag
    tag_id: a5ec962c-01b4-4137-aa83-d2682bda528b
condition: []
action:
  - service: lock.open
    data: {}
    target:
      entity_id: lock.danalock_v3_btzb_doorlock
mode: single
alias: Tag Ovi is scanned
description: ""
trigger:
  - platform: tag
    tag_id: a5ec962c-01b4-4137-aa83-d2682bda528b
condition: []
action:
  - device_id: 7cd18cb6c068fb1dff85c99d4872a25b
    domain: lock
    entity_id: lock.danalock_v3_btzb_doorlock
    type: unlock
mode: single

At first glance, I assume because the service call is lock.unlock, not lock.open.

1 Like