#I keep recieving a malformed message
1 messages · Page 1 of 1 (latest)
- alias: YouTube Subscriber Milestone
trigger:
platform: numeric_state
entity_id: sensor.short_cirkuitz_subscribers
above: 0
action:
- choose:
- conditions:
- condition: numeric_state
entity_id: sensor.short_cirkuitz_subscribers
above: 100
below: 500
sequence:
- service: script.notify_discord_and_play_music
data:
milestone: "100 Subscribers"
- conditions:
- condition: numeric_state
entity_id: sensor.short_cirkuitz_subscribers
above: 500
below: 1000
sequence:
- service: script.notify_discord_and_play_music
data:
milestone: "500 Subscribers"
- conditions:
- condition: numeric_state
entity_id: sensor.short_cirkuitz_subscribers
above: 1000
below: 5000
sequence:
- service: script.notify_discord_and_play_music
data:
milestone: "1000 Subscribers"
- conditions:
- condition: numeric_state
entity_id: sensor.short_cirkuitz_subscribers
above: 5000
below: 10000
sequence:
- service: script.notify_discord_and_play_music
data:
milestone: "10000 Subscribers"
- conditions:
- condition: numeric_state
entity_id: sensor.short_cirkuitz_subscribers
above: 10000
below: 50000
sequence:
- service: script.notify_discord_and_play_music
data:
milestone: "50000 Subscribers"
- conditions:
- condition: numeric_state
entity_id: sensor.short_cirkuitz_subscribers
above: 50000
below: 100000
sequence:
- service: script.notify_discord_and_play_music
data:
milestone: "100000 Subscribers"
- conditions:
- condition: numeric_state
entity_id: sensor.short_cirkuitz_subscribers
above: 100000
below: 500000
sequence:
- service: script.notify_discord_and_play_music
data:
milestone: "500000 Subscribers"
- conditions:
- condition: numeric_state
entity_id: sensor.short_cirkuitz_subscribers
above: 500000
below: 1000000
sequence:
- service: script.notify_discord_and_play_music
data:
milestone: "1 MILLION Subscribers"
- service: persistent_notification.create
data:
message: YouTube Subscriber Milestone Reached: {{ trigger.to_state.state }} Subscribers
What's the error?
Message malformed: extra keys not allowed @ data['automation']
Ah... are you pasting that code into the automation editor?
Yes
Because that won't work
OK great
You can edit the automation as YAML and then paste in the parts, correctly indented
Or you can build it in the UI editor entirely
Ok
New error: "Message malformed: required key not provided @ data['trigger'][1]['platform']"
mode: single
trigger:
- platform: numeric_state
entity_id:
- sensor.short_cirkuitz_subscribers
above: 0
action:
- choose:
- conditions:
- condition: numeric_state
entity_id: sensor.short_cirkuitz_subscribers
above: 100
below: 500
sequence:
- service: script.notify_discord_and_play_music
data:
milestone: "100 Subscribers"
- conditions:
- condition: numeric_state
entity_id: sensor.short_cirkuitz_subscribers
above: 500
below: 1000
sequence:
- service: script.notify_discord_and_play_music
data:
milestone: "500 Subscribers"
- conditions:
- condition: numeric_state
entity_id: sensor.short_cirkuitz_subscribers
above: 1000
below: 5000
sequence:
- service: script.notify_discord_and_play_music
data:
milestone: "1,000 Subscribers"
- conditions:
- condition: numeric_state
entity_id: sensor.short_cirkuitz_subscribers
above: 5000
below: 10000
sequence:
- service: script.notify_discord_and_play_music
data:
milestone: "5,000 Subscribers"
- conditions:
- condition: numeric_state
entity_id: sensor.short_cirkuitz_subscribers
above: 10000
below: 50000
sequence:
- service: script.notify_discord_and_play_music
data:
milestone: "10,000 Subscribers"
- conditions:
- condition: numeric_state
entity_id: sensor.short_cirkuitz_subscribers
above: 50000
below: 100000
sequence:
- service: script.notify_discord_and_play_music
data:
milestone: "50,000 Subscribers"
- conditions:
- condition: numeric_state
entity_id: sensor.short_cirkuitz_subscribers
above: 100000
below: 500000
sequence:
- service: script.notify_discord_and_play_music
data:
milestone: "100,000 Subscribers"
- conditions:
- condition: numeric_state
entity_id: sensor.short_cirkuitz_subscribers
above: 500000
below: 1000000
sequence:
- service: script.notify_discord_and_play_music
data:
milestone: "500,000 Subscribers"
- conditions:
- condition: numeric_state
entity_id: sensor.short_cirkuitz_subscribers
above: 1000000
below: 1000500
sequence:
- service: script.notify_discord_and_play_music
data:
milestone: "1,000,000 Subscribers"
- service: persistent_notification.create
data:
message: "Youtube Subscriber Milestone Reached: {{ trigger.to_state.state }} Subscribers"```
Your YAML is broken, again, and you didn't say where you pasted that
trigger:
- platform: numeric_state
entity_id:
- sensor.short_cirkuitz_subscribers
above: 0
action:
^^^^^^
``` `action` has to be at the same indent level as `trigger`
Again, you can entirely build that in the UI editor and then look at the YAML created
(also, that trigger won't work for you)
Why not?
This was pasted in the yaml automation editor
@safe quest There are three sections to an automation:
trigger: When any one of these becomes true the automation starts processing. Only one trigger is ever responsible for starting an automation, if you make aconditionthat checks for more than one having started the automation then the condition can never be true.condition: These are checked after atriggerstarts the processing, and must be true for the automation to continue.action: This is the part that does something, and can also include further conditions.
Because that'll only fire when it goes from 0 or below to above 0, once above 0 it won't re-trigger
- platform: state
entity_id:
- sensor.short_cirkuitz_subscribers
``` will do what you want
I tried putting it at the same indent level and still getting the same message
mode: single
trigger:
- platform: state
entity_id:
- sensor.short_cirkuitz_subscribers
above: 0
action:
- choose:
- conditions:
- condition: numeric_state
entity_id: sensor.short_cirkuitz_subscribers
above: 100
below: 500
sequence:
- service: script.notify_discord_and_play_music
data:
milestone: "100 Subscribers"
- conditions:
- condition: numeric_state
entity_id: sensor.short_cirkuitz_subscribers
above: 500
below: 1000
sequence:
- service: script.notify_discord_and_play_music
data:
milestone: "500 Subscribers"
- conditions:
- condition: numeric_state
entity_id: sensor.short_cirkuitz_subscribers
above: 1000
below: 5000
sequence:
- service: script.notify_discord_and_play_music
data:
milestone: "1,000 Subscribers"
- conditions:
- condition: numeric_state
entity_id: sensor.short_cirkuitz_subscribers
above: 5000
below: 10000
sequence:
- service: script.notify_discord_and_play_music
data:
milestone: "5,000 Subscribers"
- conditions:
- condition: numeric_state
entity_id: sensor.short_cirkuitz_subscribers
above: 10000
below: 50000
sequence:
- service: script.notify_discord_and_play_music
data:
milestone: "10,000 Subscribers"
- conditions:
- condition: numeric_state
entity_id: sensor.short_cirkuitz_subscribers
above: 50000
below: 100000
sequence:
- service: script.notify_discord_and_play_music
data:
milestone: "50,000 Subscribers"
- conditions:
- condition: numeric_state
entity_id: sensor.short_cirkuitz_subscribers
above: 100000
below: 500000
sequence:
- service: script.notify_discord_and_play_music
data:
milestone: "100,000 Subscribers"
- conditions:
- condition: numeric_state
entity_id: sensor.short_cirkuitz_subscribers
above: 500000
below: 1000000
sequence:
- service: script.notify_discord_and_play_music
data:
milestone: "500,000 Subscribers"
- conditions:
- condition: numeric_state
entity_id: sensor.short_cirkuitz_subscribers
above: 1000000
below: 1000500
sequence:
- service: script.notify_discord_and_play_music
data:
milestone: "1,000,000 Subscribers"
- service: persistent_notification.create
data:
message: "Youtube Subscriber Milestone Reached: {{ trigger.to_state.state }} Subscribers"