New Automation is not triggering as expected

Hi all,

I created this automation but HA doesn’t trigger it when the window sersor (Shelly Windows) changes from Close to Open:

- id: '00016'
  alias: LuceBox
  initial_state: true
  trigger:
    platform: state
    entity_id:
      - binary_sensor.sensore_portone_box
    from: close
    to: open
  condition: []
  - condition: state
    entity_id: switch.luce_box_mqtt
    state: 'off'
  action:
  - entity_id: switch.luce_box_mqtt
    service: switch.turn_on
  - delay: '60'
  - entity_id: switch.luce_box_mqtt
    service: switch.turn_off

What is wrong in the test above?

Home Assistant 0.110.4
HassOS 4.8

thanks

Try :

- id: '00016'
  alias: LuceBox
  initial_state: true
  trigger:
    platform: state
    entity_id:
      - binary_sensor.sensore_portone_box
    platform: state
    to: 'on'  
  condition: []
  - condition: state
    entity_id: switch.luce_box_mqtt
    state: 'off'
  action:
  - entity_id: switch.luce_box_mqtt
    service: switch.turn_on
  - delay: '60'
  - entity_id: switch.luce_box_mqtt
    service: switch.turn_off

Although a binary_sensor shows ‘open’ and ‘close’ in the front-end, internally it is ‘on’ and ‘off’

Edit : if ‘on’ does not work, try with ‘off’. You might want to look in developer tools -> states what is exactly open and close.

Changed with on instead of open and it works. thank

Can you please mark Francis’s post as a solution, this helps others searching