Weird problem with automations and multiple actions

I just modified one of my automations to add a notification to Slack.

- alias: Front Door Open
  trigger:
    platform: event
    event_type: zwave.node_event
    event_data:
      entity_id: zwave.aeon_front_door
  condition:
    condition: template
    value_template: "{{ trigger.event.data.basic_level > 0 }}"
  action:
    - service: python_script.set_state
      data_template:
        entity_id: binary_sensor.aeon_front_door
        state: 'on'
    - service: notify.slack
      data:
        title: "Motion"
        message: "Front Door is open"

The automation works and the binary_sensor.aeon_front_door sensor reflects the correct value. However, the second service never gets fired by the automation.

What’s weird is that if I manually execute the service from the automation control panel on the UI, it works correctly so it looks like, for some reason, the action service chaining isn’t working when the automation is fired for real.

Anyone seen this before? Any ideas?

Cheers!

Scott…

Please look in home-assistant.log. There will be messages in there showing the automation running and executing each step.

Are you sure you’re not seeing any errors?

Phil,
Thanks for the reply. Nope, there’s nothing in the logs. If I modify the automation to have the notification have a trigger by itself (set on the binary_sensor changing state) then it all just works. It’s just the chaining in the same zwave event that appears to be broken somehow.

2020-08-05 15:43:41 INFO (MainThread) [homeassistant.components.automation] Executing Front Door Open
2020-08-05 15:43:41 INFO (MainThread) [homeassistant.components.automation] Front Door Open: Running script
2020-08-05 15:43:41 INFO (MainThread) [homeassistant.components.automation] Front Door Open: Executing step call service
2020-08-05 15:43:41 INFO (SyncWorker_5) [homeassistant.components.python_script] Executing set_state.py: {'entity_id': 'binary_sensor.aeon_front_door', 'state': 'on'}
2020-08-05 15:43:41 INFO (MainThread) [homeassistant.components.automation] Front Door Open: Executing step call service

Cheers

Scott…

It certainly looks like it’s calling the notify.slack service.

How do you have your logger configured? You can try the following and it should print out the details of the service calls:

logger:
  default: info
  logs:
    homeassistant.core: debug

I would be very interested to see what that looks like.

Phil,

Apologies for the delay in replying. The issue here seems to be the return value from the set_state python script. When I flip the two actions (with the notify first), it works so there’s a false return value there that’s causing the service action chain to be terminated midway (as per the specs). When I get a chance, I’ll dig in and debug some more…

Cheers!

Scott…