@gfpinto wrote:
i’m triyng to automate a switch.
The trigger is ok… it works every minute… in the action i have problems,
it works on the wrong minute… my code:(automation.yaml)
- id: '1583526600964' alias: piscina_bomba_auto trigger: - platform: time_pattern minutes: /1 action: - entity_id: switch.sonoff_10009ace1f service_template: "{% if states.sensor.time.state == states.input_datetime.h_pb_on_3b.state\ \ %}\n switch.turn_on\n{% else %}\n switch.turn_off\n{% endif %}\n"
the problem is:
- i have set the input_datetime.h_pb_on_3b = 10:30 for example
- the trigger shoots every minute
- the switch only change to ON at 10:31
- at 10:30 trigger… if the switch is ON it changes to OFF, and at 10:31 to ON again
i want at datetime.h_pb_on_3b.state turn the switch_on… not one minute later
Thanks
Posts: 7
Participants: 3