Today is my first time to test simple if else in automation, but i can’t save it. It shows this error message:
Message malformed: offset on should be format 'HH:MM', 'HH:MM:SS' or 'HH:MM:SS.F' for dictionary value @ data['action'][0]['choose'][0]['conditions'][0]['for']
If motion sensor binary_sensor.a4b0003832 is on, turn on switch.belkin_smart_plug_1, else turn on switch.belkin_smart_plug_2.
alias: if else
description: ''
mode: single
trigger:
- platform: state
entity_id: binary_sensor.a4b0003832
condition: []
action:
- choose:
- conditions:
- condition: state
entity_id: binary_sensor.a4b0003832
state: ''
for: 'on'
attribute: state
sequence:
- service: switch.turn_on
target:
entity_id: switch.belkin_smart_plug_1
default:
- service: switch.turn_on
target:
entity_id: switch.belkin_smart_plug_2
Thanks Tom.
Now, i try another new code, why switch.belkin_smart_plug_1 cannot be turned on once the binary_sensor.wemo_motion is on?
Every time i trigger the motion, only switch.belkin_smart_plug_2 will turn on, nothing happen to switch.belkin_smart_plug_1. Why?
If the motion is triggered, turn on smart plug 1, after that turn off smart plug 2. Else, turn on smart plug 2, after that turn off smart plug 1.