Automations work for a while then stop until manually triggered in the HA console

I am having some trouble with zigbee to HA to a z-wave socket automation working for a period of time then stopping working.

The automation is a simple z-wave device toggle state from a zigbee switch. It works fine for a period of time and then just stops working.

When I go into the HA configuration in Lovelace, manually trigger the automation, the automation then starts working perfectly again for a period time.

I am not sure what to do to troubleshoot why it stops, the Zigbee control is via a dedicated deCONZ server running on a Pi and the switch activation shows in the logs, but the automation doesn’t run.

Any help would be really appreciated.

What exactly do you mean when you say this? What exact steps are you doing at that point?

Hey,

In Lovelace, I open the menu configuration -> automations. Click on the i in the circle, the automation information opens.
In the bottom right of that dialogue is a trigger button. I click the trigger button. The automation then runs after being manually triggered.

After it has been triggered that way then the wall switch starts working again to trigger the automation.

There is no config change, just triggering the automation this way re-enables the automation.

The automation was created in the Lovelace interface and not as a manual yaml.

Ok, you’ll need to post the code for the automation.

make sure you post it as text and that it’s properly formatted.

This is the config generated by Lovelace automations editor into automations.yaml.

- id: '1574031213191'
  alias: Toggle Stair lights from bathroom
  description: ''
  trigger:
  - device_id: bf11f6b864d7422980375c1b8240c534
    domain: deconz
    platform: device
    subtype: right
    type: remote_button_short_press
  condition: []
  action:
  - device_id: eb26dd1856e749af9dfbb90d41a2ff9e
    domain: switch
    entity_id: switch.fibaro_system_fgwpe_f_wall_plug_gen5_switch
    type: toggle

I have to admit I have no idea how the device automations are supposed to work and I don’t have any deconz stuff.

Do those automations get included in the states page with a state of ‘on’ or ‘off’ like other automations do?

Is there any way to check that your trigger is coming thru when the automation eventually quits working?

No worries. In the HA logs, the incoming deconz event shows and in decomz gui, the wall switch is seen triggered. I’ll need to re-enable debuging to capture the full details as I don’t have them saved.

The automation states output below.

last_triggered: '2019-11-23T11:30:09.892442+00:00'
id: '1574031213191'
friendly_name: Toggle Stair lights from bathroom

In the history, the automation shows “on” all the time, unless I’ve turned it off to test it.

It’s odd, the set up works, just randomly stops working after a few hours and then won’t run again until it’s triggered.

I thought it might be a RAM / Swapfile issue on the Pi and even removed the Zigbee Raspbee HAT from the HA Pi and installed a dedicated deCONZ server Pi to reduce the swapfile from 80% to 10%. This made things a bit better, but still hasn’t completely solved the issue

I don’t know, but I just compared with an automation I have created by the automations editor :

- id: '1572890752657'
  alias: Licht buiten aan
  description: ''
  trigger:
  - device_id: 85362a5cfac5442da8d9fb07ce9ffdb1
    domain: binary_sensor
    entity_id: binary_sensor.0xccccccfffe2fb287_occupancy
    platform: device
    type: motion

My trigger has a entity_id, I don’t see it in yours ?

I had noticed that, the deconz exposed switch shows as a device, but only has the battery level entity under it. Is the entity_id essential for automation or is device_id ok?

Just to clarify, the state of the automation needs to be ‘on’ for it to run.

It’s likely that there is no entity_id since he’s using an event in the automation which won’t have any associated entity_id.

Yes, I wasn’t clear, I mean the automation is showing on all the time and not off.

I really have no idea why it would start working (or even how it would) from just the automation being triggered again.

There has to be something else causing it. and I would think it would have to be deconz related, not the automation functionality.

Hmmm ! but it does have a device I’d (some long pseudo random generated string) inlue of any other explanation I’d assume this was the state machine reference to the entity which it hangs other stuff to
Device I’d, friendly name, domain, child attributes etc.