Hi all, I am new here and to yaml.
Tried to do a nice setup with choice and have validated externally but HA don’t accept my yaml ;(
(I measure the power drawn by a kitchen fan and like my roof fan to “follow”)
I get the error: “Message malformed: required key not provided @ data[‘action’]”
Can anyone tell me what’s wrong here:
alias: roof-fan
description: ''
trigger:
- platform: device
device_id: a7668ec42b399259f2386e0b39daea12
entity_id: sensor.koksflakt_uppe_power
domain: sensor
mode: restart
action:
- choose:
# IF 5W - 20W turn on half power
- conditions:
- condition:
above: 5
below: 20
sequence:
- service: switch.turn_on
target:
entity_id:
- switch.ventilation_halv
- service: switch.turn_off
target:
entity_id:
- switch.ventilation_full
# ELIF > 20W turn on full power
- conditions:
- condition:
above: 20
sequence:
- service: switch.turn_on
target:
entity_id:
- switch.ventilation_full
- service: switch.turn_off
target:
entity_id:
- switch.ventilation_halv
# ELSE < 5W turn off
default:
- service: switch.turn_off
target:
entity_id:
- switch.ventilation_halv
- switch.ventilation_full