#Automations not preforming all actions

1 messages · Page 1 of 1 (latest)

proven current
#

I'm dealing with an issue after the last release where actions are not being preformed on all devices in the action list. For example, this simple automation where there are 2 lights in the basement_bathroom area:

alias: Basement Bathroom - Motion Stopped
description: ""
triggers:
  - type: no_motion
    device_id: da875653d4e5a78ce576c831bc4e516e
    entity_id: 4367a871e2b7eb3627134bcea2cbd910
    domain: binary_sensor
    for:
      hours: 0
      minutes: 5
      seconds: 0
    trigger: device
conditions: []
actions:
  - action: light.turn_off
    data: {}
    target:
      area_id: basement_bathroom
mode: single

In this simple instance, one of the 2 lights in the area turn off. The same behavior happens if I enumerate the devices instead of targeting the area.
I am able to turn off both devices from the dashboard with no issue.

I currently have a handful of automations for different devices and scenes around my house that are exhibiting this issue. All of them have been in service and working fine for a long time.

I have deleted and re-created a broken automation but it still showed the same issue.

I have checked my ZWaveJS2MQTT logs and do not see anything come in for the devices that are not being actuated. It appears Home Assistant isn't even triggering the actions that aren't working but I am unsure how to troubleshoot any further. Any advice would be greatly appreciated.

hazy valve
#

I suggest you start with light.turn_off/on tests in the developer tools with area_id. As far as I know, entities assigned in the area, are sequentially called for the action you want to perform.

With developer action test, you will see if such issue happens more often or just in the automation (unusual case)

Also, do not use device_id and entity_id like that in the automations. Use "state" and named entites instead

#

Please also read this, which doesn't have anything directly with your problem, but will save your life in the future: https://community.home-assistant.io/t/why-and-how-to-avoid-device-ids-in-automations-and-scripts/605517

proven current
#

I had tried a full reboot yesterday and it didn't do anything. This morning I upgraded Proxmox and rebooted again, things appear to be working now. Maybe there's something to rebooting 3 times 😉

It was a very strange issue and I don't really like when problems just resolve themselves. Hopefully it stays fixed.

@hazy valve Thanks for the device_id/entity_id suggestion, I had no idea. I'll be going through everything now to make the switch. Makes me wonder how many other things I'm doing in a way that makes my life harder...

hazy valve
#

For some reason I feel issue is in your Zwave. Maybe USB problems if you have ext device for it?

proven current
#

I thought zwave too at first but I never saw any messages for the device hit MQTT. I don't even think it was getting that far. Also, the same broken device was 100% reliable when switching from the dashboard.

I had the thought it could be falling down sending multiple devices for some reason, but when I took all but the entity out of the action list it still didn't work.

hazy valve
#

if you use the "area_id" then HA will check all the entities assigned to the area and basically perform a for loop and send the same command multiple times

#

if you do it multiple times, who knows but it may be somewhere in the software a buffer overflow and commands are missed, or anything like that

#

when you use "area_id", the response to the action is usually slower

proven current
#

In testing I clicked the "split" button so it added each item from the area to the automation. Then I removed all but 1 broken device. It still didn't work after I did that.

hazy valve
#

therefore question remains, is it a device that is broken, or link between HA to devices

#

how many devices are in the area_id?

#

does it work if you try to control just this one "broken" device? Is it broken only if part of area_id or also outside this?

proven current
#

I had multiple areas affected and various devices. Master bedroom for instance has 2 nightstand lights controlled by identical zwave dimmers. One worked, the other didn't.

Adding only the broken device to the automation did not fix the problem. Controlling via the switch in the dashboard did work reliably.

I still think whatever happened was internal to HA. I don't use the the direct zwave integration so my pipeline is HA -> MQTT(Mosquitto) -> ZWaveJS2MQTT -> ZWController. If HA was doing its part I would have expected to see the broken device show up in MQTT but it never did.

I've been testing some more this morning, it appears everything is all good now.

hazy valve
#

very good. I would take a MQTT client (for example this one is good: https://mqttx.app/) and directly listen to the messages HA is sending. If MQTT message comes, then you know HA works properly.

#

At least I suspect that 1. HA doesn't send all messages or 2. there are all messages in a burst and receiver can't process them and are effectively lost.
That's why it works from dashboard (one by one) but not in an automation (burst)

Just my view

#

to better test, create a script with your area_id and execute it from dashboard (use button to run it) to test

proven current
#

I did watch for the message in MQTT directly, it never arrived.

Thanks for the help, and for the entity id suggestion, I'll definitely use that going forward.