Automation activates script but script doesn't run

Hey guys,

I’m having trouble getting my script to run which is triggered by an Automation. The script opens my shutters when I open my front door during a specific time frame only if my shutters are down (binary_sensor.rolluik).

I have a binary_sensor.away_mode which switches to ON after leaving the house for 30 minutes. Once the front door is openen this sensor switches to off. When entering the living room within 20 seconds the rfkey3 binary sensor activates the automation below.

The logbook shows the script is turned on by the automation, but my shutters do not open.

This is the automation which triggers the script:

- id: '1600928819940'
  alias: Rolluik UP bij binnenkomst na away mode
  description: ''
  - platform: state
    entity_id: binary_sensor.rf_bridge_key_3
    to: 'on'
  - condition: template
    value_template: '{{ is_state(''binary_sensor.away_mode'', ''off'') and (now() - states.binary_sensor.away_mode.last_changed).total_seconds()
      < 20 }}'
  - condition: state
    entity_id: binary_sensor.rolluik
    state: 'off'
  - condition: time
    after: '06:00'
    before: '19:00'
  - service: script.turn_on
    data: {}
    entity_id: script.rolluik_driekwart
  mode: single

The script simply opens the covers and disables the away mode automation.

The logbook shows that everything is activated but the shutters remain closed.

If I manually activate the automation within 20 seconds of arriving home, it works…

Any idea’s guy?

Paste your script please.

  alias: Rolluik Driekwart
  - service: mqtt.publish
      payload: ''
      topic: cmnd/tasmota_C36DFB/rfkey10
  - delay: 0:00:11
  - service: mqtt.publish
      payload: ''
      topic: cmnd/tasmota_C36DFB/rfkey11
  mode: single

I’m stuck then tbh. The logbook says that the script ran, but you didn’t observe any results. If you manually run the script you do observe the results, and we know the automation works because the logbook shows it firing the script :man_shrugging:

Thanks for checking anyway, I appreciate it. I’m still lost haha. I think I’m going to create a new automation and script to see if I can recreate this issue or that it somehow solves itself.

1 Like