I have a handful of Z-Wave devices that quit working with my Home Assistant: a light dimmer, a thermostat, and few 3 setting fan switches. While that is annoying, these items are not critical. The big issues is that I have some scripts called by automations that are crashing because these devices can’t be accessed. Is there a way to write a script to skip entities or devices that HA can no longer access?
That feels like a band aid on a hardly bleeding wound
Should you not just troubleshoot the failing devices or remove them completely instead of creating workarounds?
How are you using them in automation or script?
If they are triggers there should be no issue.
If they are action you can write them is as if/then script like below. I think you may also do this directly in the action. The basics is, “unavailable” should be an acceptable condition of your automation for the missing devices. If the devices states are required then automation will fail
service: script.turn_on
data_template:
entity_id: >-
{% if is_state('binary_sensor.YOURBINARYSENSOR', 'off') %}
script.script2
{% elif is_state('binary_sensor.YOURBINARYSENSOR', 'on') %}
script.script1
{% endif %}
I’d say both are equally bad.
Op post your automation that’s crashing and open a second thread for your ZWave woes.
Yes, failed devices is certainly an issue, and I will be working on fixing these. Since most of these are not frequently used, I am focusing on the automations that are more critical (e.g. my door is not getting locked because a lamp at the other end of the house isn’t responding).
Yep! Gonna do a bit more research myself first, but definitely going to address that.
As I looked at the traces more closely, I think it is just the thermostats that are currently causing the issue, because that is called first. I am sure the other devices would do the same thing though.
I have automations that are activated at a certain time or in relation to sunset/sunrise. These automations call a script. One action the scripts always call is another script that resets the temperature appropriately. This script fails because the thermostat is failing for some reason (side note, I have had issues with this thermostat in SmartThings and Hubitat as well–pretty sure it is a hardware issue). The code is:
- service: climate.set_temperature
data:
target_temp_high: 73
target_temp_low: 68
target:
entity_id:
- climate.downstairs_thermostat
- climate.upstairs_thermostat #the failing device
For reference, here is the code for the lights and fans and such:
- service: homeassistant.turn_off
data: {}
target:
entity_id:
- switch.zwave_dev1
- switch.zwave_dev2
- light.zwave_dev3
- light.zwave_fan1
- switch.zigbee_outlet1
The bad devices are all Z-Wave. Worth noting, I was a pretty early adopter (though new to HA), so these devices are a bit old as Z-wave devices go.
Call script for thermostats last. Others should work without issue and automation will just stop at thermostat call.
No need for changes and Troubleshoot zwave at you leisure