Rule to detect failed devices on an Ezlo hub?
-
This is a currently failed device on my Ezlo Plus
battery_power.level=1 battery_power.since=1648664932056 humidity_sensor.units="%" humidity_sensor.value=65.9700012207031 x_ezlo_device.battery_powered=true x_ezlo_device.category="humidity" x_ezlo_device.manufacturer="CentraLite" x_ezlo_device.model="3310-G" x_ezlo_device.parent="" x_ezlo_device.reachable=false x_ezlo_device.ready=true x_ezlo_device.room="61f08bdc123e431284c13fbc" x_ezlo_device.status="idle" x_ezlo_device.subcategory="" x_ezlo_device.type_id="CentraLite_3310-G" x_ezlo_item.battery=100 x_ezlo_item.humidity=65.9700012207031 x_ezlo_object.id="61f0bbbf123e4312a1900a18" Capabilities: battery_power, humidity_sensor, x_ezlo_device, x_ezlo_item, x_ezlo_object Actions: x_ezlo_device.device_check, x_ezlo_device.set_item_value, x_ezlo_device.set_name, x_ezlo_device.set_room, x_ezlo_device.status_check
x_ezlo_device.reachable=false
Its a Zigbee device if that makes any difference.
-
This is a currently failed device on my Ezlo Plus
battery_power.level=1 battery_power.since=1648664932056 humidity_sensor.units="%" humidity_sensor.value=65.9700012207031 x_ezlo_device.battery_powered=true x_ezlo_device.category="humidity" x_ezlo_device.manufacturer="CentraLite" x_ezlo_device.model="3310-G" x_ezlo_device.parent="" x_ezlo_device.reachable=false x_ezlo_device.ready=true x_ezlo_device.room="61f08bdc123e431284c13fbc" x_ezlo_device.status="idle" x_ezlo_device.subcategory="" x_ezlo_device.type_id="CentraLite_3310-G" x_ezlo_item.battery=100 x_ezlo_item.humidity=65.9700012207031 x_ezlo_object.id="61f0bbbf123e4312a1900a18" Capabilities: battery_power, humidity_sensor, x_ezlo_device, x_ezlo_item, x_ezlo_object Actions: x_ezlo_device.device_check, x_ezlo_device.set_item_value, x_ezlo_device.set_name, x_ezlo_device.set_room, x_ezlo_device.status_check
x_ezlo_device.reachable=false
Its a Zigbee device if that makes any difference.
@cw-kid I'm doing it like this. There may be better ways but this works for me.
I have a dynamic group for unreachable devices.
- id: groups name: Dynamic Group Controller enable: true implementation: DynamicGroupController config: groups: "UnreachableEzloDevices": name: Ezlo Devices Not Responding select: - include_controller: ezlo - include_capability: x_ezlo_device filter_expression: entity.attributes.x_ezlo_device.reachable != true
Then a global expression for the devices.
In the rule I have this setup.
The global variable
prevEzloDevicesNotResponding
is set to keep track of number of devices that are unreachable.
The local variableSend
is used to only send a notification if the number of unreachable devices is increasing or is back to zero, since after a reboot of the controller, all Zigbee devices is marked as unreachable until physically power toggled and I don't need a notification of a decreased array every time a device is reachable again until they all are.Hope this gives you some ideas.
-
@cw-kid I'm doing it like this. There may be better ways but this works for me.
I have a dynamic group for unreachable devices.
- id: groups name: Dynamic Group Controller enable: true implementation: DynamicGroupController config: groups: "UnreachableEzloDevices": name: Ezlo Devices Not Responding select: - include_controller: ezlo - include_capability: x_ezlo_device filter_expression: entity.attributes.x_ezlo_device.reachable != true
Then a global expression for the devices.
In the rule I have this setup.
The global variable
prevEzloDevicesNotResponding
is set to keep track of number of devices that are unreachable.
The local variableSend
is used to only send a notification if the number of unreachable devices is increasing or is back to zero, since after a reboot of the controller, all Zigbee devices is marked as unreachable until physically power toggled and I don't need a notification of a decreased array every time a device is reachable again until they all are.Hope this gives you some ideas.
Thanks for the detailed information.
However after adding the group in to my reactor.yaml file MSR no longer starts or runs.
My controller is called Ezlo_Plus
I've tried both "Ezlo_Plus" and "ezlo_plus"
- id: groups name: Dynamic Group Controller enable: true implementation: DynamicGroupController config: groups: "UnreachableEzloDevices": name: Ezlo Devices Not Responding select: - include_controller: Ezlo_Plus - include_capability: x_ezlo_device filter_expression: entity.attributes.x_ezlo_device.reachable != true
Does it matter where abouts in the reactor.yaml file you add this code? I just added it in the Controllers section after my last "enabled" controller .
Thanks.
-
Alternatively doing it the "old" way without using a Dynamic Group these two expressions seem to work and are correctly returning the names of the two currently failed devices on my Ezlo Plus Controller:
FailedEzlo:
each id in matchEntities( { capability: 'x_ezlo_device' } ): ( getEntity(id)?.attributes.x_ezlo_device.reachable ) !=true ? id : null
FailedNamesEzlo:
join( each id in FailedEzlo: getEntity(id)?.name ?? id, ", " )
-
Thanks for the detailed information.
However after adding the group in to my reactor.yaml file MSR no longer starts or runs.
My controller is called Ezlo_Plus
I've tried both "Ezlo_Plus" and "ezlo_plus"
- id: groups name: Dynamic Group Controller enable: true implementation: DynamicGroupController config: groups: "UnreachableEzloDevices": name: Ezlo Devices Not Responding select: - include_controller: Ezlo_Plus - include_capability: x_ezlo_device filter_expression: entity.attributes.x_ezlo_device.reachable != true
Does it matter where abouts in the reactor.yaml file you add this code? I just added it in the Controllers section after my last "enabled" controller .
Thanks.
@cw-kid The indentation of the groups controller was off in my post. I've corrected it. Please try again with correct indentation and your Reactor should start.
The groups controller is in the right place in your config andinclude_controller
should be theid
of the Ezlo Plus controller. -
@cw-kid The indentation of the groups controller was off in my post. I've corrected it. Please try again with correct indentation and your Reactor should start.
The groups controller is in the right place in your config andinclude_controller
should be theid
of the Ezlo Plus controller. -
Any time you edit a config file and then Reactor doesn't start, you've likely corrupted the file. There's a troubleshooting section for startup in the documentation that will help you look at the logs (yes, once again, go look at the logs), and there are tools like https://yamlchecker.com that will also help you find errors, and there's this handy YAML editor https://onlineyamltools.com/edit-yaml
Edit: I wanted to add here that I routinely break my config files, so as fluent as I consider myself to be with YAML (begrudgingly, I'll admit), it's just touchy and mistakes are easy to make. I am working on a graphical editor for settings in the background, but it's a huge undertaking and a bit of an "all or nothing" deal, so it's got a long road ahead of it (or, really, I do).
-
T toggledbits locked this topic on