Help with this automation

I’m a newby with automation in hassio.
Can someone help me to figure out this below.
When I switch on input_boolean.borne_tesla,
I want to turn off switch.cuisiniere
Activate a timer for 3 sec
Then turn on switch.borne
See below… It’s not working
Tks for your help

  • id: Start-Borne
    alias: ‘Start-Borne’
    trigger:
    • platform: state
      entity_id: input_boolean.borne_tesla
      from: ‘off’
      to: ‘on’
      action:
      service: switch.turn_off
      entity_id: switch.cuisiniere
      delay: 00:00:03 # Waits 3 secondes
      service: switch.turn_on
      entity_id: switch.borne

Please edit your post and format your code as per the blue banner at the top of the page.

Your ID is invalid. Use only lower case letters, numbers and the underscore character “_”. e.g. start_borne

Thanks, still having something else wrong.
Regards

Until you do this I am unable to help further:

hi speedmax,
for code highlighting please look on the instruction on the top of the side… it’s easy an necessary

i think this would work

  - alias: Start-Borne
    trigger:
        platform: state
        entity_id: input_boolean.borne_tesla
        to: ‘on’
    action:
        - service: switch.turn_off
          entity_id: switch.cuisiniere
        - delay: 00:00:03 # Waits 3 secondes
        - service: switch.turn_on
          entity_id: switch.borne

That won’t work because the quotes on the word ‘on’ are the incorrect quote type. You must have copied and pasted this from somewhere. Don’t copy and paste code when it’s not properly formatted.

  - alias: Start-Borne
    trigger:
        platform: state
        entity_id: input_boolean.borne_tesla
        to: 'on'
    action:
        - service: switch.turn_off
          entity_id: switch.cuisiniere
        - delay:
            seconds: 3
        - service: switch.turn_on
          entity_id: switch.borne

@speedmax the reason your automation isn’t working is because you don’t treat the action section as a list. See how the example above has dashes next to each service, delay, and service? Those indicate that the action section is a list of items to be executed and not a single item. When you do not have the dashes, only the last action will be executed.

1 Like

good you use this vs the 00:00:03 notation.
as per @VDRainer 's research 0.80.0b1 - Unable to remove unknown listener · Issue #17204 · home-assistant/core · GitHub, using 00:00:03 could lead to the infamous unable to remove unknown listener warning in the logs.
‘00:00:03’ does make a difference, as is instructed on Script Syntax - Home Assistant (havent seen the warning ever since I changed that, but delay: seconds: 3 takes all risks out.

2 Likes

update is in order here, because Ive just found out that homeassistant.log isnt showing whats in the dev-info panel. Don’t know how that’s possible, but it’s very relevant, since I believed it to have stopped the warning…

Unable to remove unknown listener <function async_track_point_in_utc_time.<locals>.point_in_time_listener at 0x6ddd2d20>
3:37 PM core.py (WARNING)
Unable to remove unknown listener <function async_track_point_in_utc_time.<locals>.point_in_time_listener at 0x6ddabe88>
3:37 PM core.py (WARNING)
Unable to remove unknown listener <function async_track_point_in_utc_time.<locals>.point_in_time_listener at 0x6d73a7c8>
3:37 PM core.py (WARNING)
Unable to remove unknown listener <function async_track_point_in_utc_time.<locals>.point_in_time_listener at 0x6e33a030>
3:37 PM core.py (WARNING)
Unable to remove unknown listener <function async_track_point_in_utc_time.<locals>.point_in_time_listener at 0x6e2f42b8>
3:37 PM core.py (WARNING)
Unable to remove unknown listener <function async_track_point_in_utc_time.<locals>.point_in_time_listener at 0x6ddd28a0>
3:36 PM core.py (WARNING)
Unable to remove unknown listener <function async_track_point_in_utc_time.<locals>.point_in_time_listener at 0x6d714108>
3:36 PM core.py (WARNING)
Unable to remove unknown listener <function async_track_point_in_utc_time.<locals>.point_in_time_listener at 0x6d955b70>
3:36 PM core.py (WARNING)

It work! Many thanks!

1 Like