Ultimately, what I was trying to achieve was to display as an entity a binary_sensor for a door and then through a tap_action lock/unlock a zwave lock associated with that door. It failed miserably and so I wanted to make sure the code I was using actually worked correctly before trying to adapt it.
In my raw configuration I have a custom card as follows which I am trying to lock/unlock a zwave lock:
- type: entities
entities:
- type: 'custom:multiple-entity-row'
entity: lock.garage_entry_lock
state_color: true
secondary_info: last-changed
tap_action:
action: call-service
service: |
[[[
return (entity.state === "locked") ? "lock.unlock" : "lock.lock";
]]]
service_data:
entity_id: entity
Instead of the lock locking/unlocking, I get an error pop up saying: "Failed to call service [[[ return (entity/state === “locked”) ? “lock. Service not found.”
What’s wrong with it? Rather than just giving me the answer, can someone explain what I’ve done wrong (unless I’m hopelessly out to lunch) … it’s strangely satisfying to be able to debug code so please don’t deny me the pleasure