Hi guys…
I have Aeotec garage door controller. So far so good… Everything working through Z-wave JS. I am wondering if there is a way to display the battery level of the sensor. I’ve been searching around but couldn’t find anything that will help me. So far I know that there is a read only parameter 42 in the configuration which I believe is what I need to use to get the reading… So is there any way to get that info … and if there is a way… how ???
any help greatly appreciated
Parameter 42 only shows a binary state, normal or low. So the best you can do is a binary_sensor
. One way to do this is by using a trigger-based binary sensor template:
template:
- trigger:
- platform: zwave_js.value_updated
entity_id: cover.right_garage_door_opener
command_class: 112
property: 42
binary_sensor:
- name: Right Garage Door Opener Battery Level
state: "{{ trigger.current_value_raw == 15 }}"
availability: "{{ trigger.current_value_raw in [0, 15] }}"
device_class: battery
Whenever the value of the configuration parameter changes, the sensor will update. Value 0 is normal, value 15 is low battery.
There is a caveat to this approach. You will need to poll the configuration value to ensure the template is up-to-date, for at least one reason. First, if HA restarts and the value changes, then the template won’t be triggered. A Get must be issued to force the update. Second, I don’t really know if the device actively sends updated reports. That’s rare for config parameters. I’ve had this device for a few years and the battery is still “Normal”.
You can configure a time based automation that makes a service call to refresh the value. Probably once a day or once a week is good enough.
service: zwave_js.invoke_cc_api
data:
command_class: '112'
method_name: get
parameters:
- 42
target:
entity_id: cover.right_garage_door_opener
Another approach would be to make an automation instead of a template sensor. The automation would use the same type of trigger, but you could just send a notification if it goes low, or take some other action. You can do this from the UI with a Device Trigger. Device Triggers are sometimes a little weird though, I’ve noticed the editor UI has problems with zero values in the triggers.
Thank you…
I was hoping that the device is returning actual battery value. But I guess low battery indicator will suffice. Thank you for your help