Automation with Yaml & Jinja - TV Power on/off button

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 %}

Hi ,

Here the HA doc for trigger. There are several problems in yours.
Did you write that or did you get advice somewhere?

Also please format your post correctly for the forum so we can see if the indentation is correct, see: https://community.home-assistant.io/t/how-to-help-us-help-you-or-how-to-ask-a-good-question/114371#oneone-format-it-properly-16