I am newbie with Yaml and Jinja.
I have already 2 working automation, but i want put them in one automation. I want them one button: turn on and turn off.
First, I want get to work turn off automation with Yaml & Jinja.
I get error: Message malformed: required key not provided @ data[‘actions’]
What is wrong with this?
alias: LG TV test
description: YAML
{% if states(‘media_player.lg_webos_smart_tv’) | string == “on” %}
triggers:
device_id: a444ca1ebc7870321e59396954935asdasd
domain: webostv
type: webostv.turn_on
trigger: device
actions:
data: {}
action: media_player.turn_off
target:
entity_id: media_player.lg_webos_smart_tv
{% else %}
{% endif %}