Your automationâs trigger is using the event platform. Therefore the automationâs action cannot refer to trigger.payload because it doesnât exist.
When using the event platform as a trigger, here is what the Trigger State Object offers:
Template variable
Data
trigger.platform
Hardcoded: event.
trigger.event
Event object that matched.
trigger.event.data
Optional data
Therefore your automationâs action can refer to: trigger.event.data.scene_id
You, sir, are the hero of the day! Thank you very much, that works like a charm!
Maybe you could help me out with one more thing: I want to unlock the door directly on one of the codes, but there has been changes in Z-Wave, so I have to use identity_id to make it work. But I canât get it right.
Invalid config for [automation]: expected dict for dictionary value @ data[âactionâ][0][âdataâ]. Got None. (See /home/homeassistant/.homeassistant/configuration.yaml, line 16). Please check the docs at Automation - Home Assistant
So I canât understand how I get that entity id to work. The name of the lock is right.
And youâre right again! Thanks again! Only problem now is that they have changed from lock.unlock to lock.open, (nothingâs changed there, sorry) the lock.open service doesnât work! The GUI says âcould not call service lock/openâ, and nothing happens in the log. But I am guessing you donât know why that can be. Iâll open a new thread on that.
The working code was now lock.unlock. SO now I have it sending the scene number on MQTT and unlocking at once on code 1. Final question: Is it possible to make it react to boolean or? Like this:
- alias: Lüse opp dør med Popp kode 1
action:
data:
entity_id: lock.id_lock_150
service: lock.unlock
condition: []
id: '110234523457'
trigger:
platform: event
event_type: zwave.scene_activated
event_data:
entity_id: zwave.popp
scene_id: 1 or 2
it works on 1 if I only use that, or 2 if I only use that, but thereâs obviously something wrong with the logic for âorâ.
I can tell you are using the Automation Editor to compose your automations. It sorts everything in alphabetical order thereby making the resulting automation needlessly difficult for humans to read.
Thanks! Actually Iâm doing them in Geany. But my first automations were purely copied from the forum, so thatâs probably why the stuff is in a weird sequence, with the action before the trigger.
Edit: Doing them in the editor doesnât work because it eats my #### that I use between the automations to separate them, and it doesnât always play nice with Norwegian special characters Ìøü.
If you have no further questions concerning this automation, you can do the community a service by marking my reply (containing the answer) with the Solution tag. Only you, the author this topic, can choose the reply that represents the answer to your question.
By marking it with the Solution tag, it will automatically place a check-mark next to the topicâs title. This indicates to other users that this topic has an accepted Solution. It will also place a link under your first post that leads to the solution. All this helps other users, who many have a similar question, find answers.