Hi Community,
I’m stuck with a script problem; I’ve written what I think is valid syntax but I’m getting an error when I try to save the script and nothing I’ve tried resolves it.
The issue seems to be with the ‘then:’ clause of a if-then-else block. My syntax looks, as far as I can see, the same as examples in the HA documentation, so I’m a bit stumped by the error.
The error is this:
- Message malformed: Unable to determine action @ data[‘sequence’][0][‘choose’][3][‘sequence’][1][‘then’][0]
The script looks like this:
alias: MVHR fan speed set
sequence:
- choose:
- conditions:
- condition: state
entity_id: input_select.mvhr_control_mode
state: "OFF"
sequence:
- type: turn_off
device_id: 2e18b4caaecc076d728e18cb34326705
entity_id: switch.vent_system
domain: switch
- type: turn_off
device_id: 2e18b4caaecc076d728e18cb34326705
entity_id: switch.vent_system_2
domain: switch
- conditions:
- condition: state
entity_id: input_select.mvhr_control_mode
state: Purge
sequence:
- type: turn_on
device_id: 2e18b4caaecc076d728e18cb34326705
entity_id: switch.vent_system
domain: switch
- type: turn_on
device_id: 62140836650d4002b81e4c5b4336be0c
entity_id: light.vent_speed
domain: light
brightness_pct: 81
- conditions:
- condition: state
entity_id: input_select.mvhr_control_mode
state: Manual
sequence:
- type: turn_on
device_id: 2e18b4caaecc076d728e18cb34326705
entity_id: switch.vent_system
domain: switch
- conditions:
- condition: state
entity_id: input_select.mvhr_control_mode
state: Auto
sequence:
- type: turn_on
device_id: 2e18b4caaecc076d728e18cb34326705
entity_id: switch.vent_system
domain: switch
- if:
- alias: daytime
condition: time
after: "06:30:00"
before: "22:30:00"
then:
- variables:
fan_base: 45
mult: 2
fan_speed: >-
{{ fan_base + mult * (
states('sensor.mvhr_sensors_air_temperature_3') -
state_attr('climate.wiser_lounge', 'current_temperature') ) }}
- service: light.turn_on
data:
brightness_pct: "{{ fan_speed }}"
target:
entity_id: light.vent_speed
else:
- variables:
fan_base: 30
mult: 1
fan_speed: >-
{{ fan_base + mult * (
states('sensor.mvhr_sensors_air_temperature_3') -
state_attr('climate.wiser_lounge', 'current_temperature') ) }}
- service: light.turn_on
data:
brightness_pct: "{{ fan_speed }}"
target:
entity_id: light.vent_speed
mode: single
icon: mdi:fan-chevron-up
Any idea why I’m getting that error? Probably a newbie error, but I can’t see it for looking!
Thanks!