Hi,
I am trying to automate it so that when my homepod mini starts to play my radio alarm, my (tradfri) lights also switch on from 0% to 50% within 5 minutes. I got to below code, but I get the error Message malformed: extra keys not allowed @ data[‘automation’]:
automation:
- alias: "Turn on bedroom light when HomePod mini plays"
trigger:
- platform: state
entity_id: media_player.bedroom # your HomePod mini entity ID
to: playing
condition:
- condition: time
after: "06:00:00"
before: "09:00:00"
action:
- service: light.turn_on
target:
entity_id: light.bedroom_light # your bedroom light entity ID
data:
brightness_pct: 50
transition: 300 # 300 seconds = 5 minutes
In the yaml editor of the automation which i started with the visual editor
This also did not work:
automation mine:
- alias: "Turn on bedroom light when HomePod mini plays"
trigger:
- platform: state
entity_id: media_player.bedroom # your HomePod mini entity ID
to: playing
condition:
- condition: time
after: "06:00:00"
before: "09:00:00"
action:
- service: light.turn_on
target:
entity_id: light.bedroom_light # your bedroom light entity ID
data:
brightness_pct: 50
transition: 300 # 300 seconds = 5 minutes
You didn’t answer my question, so I will assume you added the things I mentioned in my previous post. Remove them from your automation.
For reference, here’s how a new automation looks like in the Automation Editor in YAML mode. Notice that it doesn’t include an automation: key, there’s no hyphenated alias key and all the keys description, mode, trigger, condition and action are not indented.
Thanks! So I think I am a step further, but it gives me now the error: Message malformed: extra keys not allowed @ data[‘transition’] with the following code
Please consider marking my post above with the Solution tag. It will automatically place a check-mark next to the topic’s title which signals to other users that this topic has been resolved. This helps users find answers to similar questions.
I am sorry I have the same problem. I created an automation with the Automation Editor and then switched over to YAML mode. I want it to have several sub parts, so I wanted to add automation: and automation 2: but thats not accepted. Where do I edit this in a way thats allowed? thank you.