Hello, I previously used the deprecated ZWave integration in my Home Assistant Core install with an automation to monitor the time period since last activity of my battery supplied modules and notify if a module didn’t talk to the controller for too long.
I found the battery level info sent by the modules aren’t reliable, I had a module that worked for months with 0% ; and recently a module stopped working with battery readout of 100% while the battery voltage (without load) was 1.05V instead of 3.6V. So this automation is more reliable to notify me if a module didn’t wake up as expected.
alias: Zwave - Module ne répond plus
description: Envoie une notification si un module Zwave sur batterie ne répond plus.
trigger:
- platform: time
at: '19:00:00'
condition:
- condition: or
conditions:
- condition: template
value_template: >
{%- set max_delay = 36000 -%} {% set ns = namespace(found=false) -%}
{% for entity_id in states.group.zwave_activity.attributes.entity_id
-%}
{% set parts = entity_id.split('.') -%}
{%- if (as_timestamp(now()) | int) - ((as_timestamp(strptime(states[parts[0]][parts[1]].attributes.receivedTS | string | truncate(19,True,'',0),'%Y-%m-%d %H:%M:%S:%f'))) | int) > 36000 -%}
{% set ns.found = true -%}
{% endif -%}
{% endfor -%} {{ ns.found }}
action:
- service: persistent_notification.create
data:
notification_id: >
{%- set max_delay = 36000 -%} {%- for entity_id in
states.group.zwave_activity.attributes.entity_id -%}
{%- set parts = entity_id.split('.') -%}
{%- if (as_timestamp(now()) | int) - ((as_timestamp(strptime(states[parts[0]][parts[1]].attributes.receivedTS | string | truncate(19,True,'',0),'%Y-%m-%d %H:%M:%S:%f'))) | int) > 36000 -%}
{{ states[parts[0]][parts[1]].name }}
{%- endif -%}
{%- endfor -%}
title: Module Zwave ne répond plus
message: >
{%- set max_delay = 36000 -%} {%- for entity_id in
states.group.zwave_activity.attributes.entity_id -%}
{%- set parts = entity_id.split('.') -%}
{%- if (as_timestamp(now()) | int) - ((as_timestamp(strptime(states[parts[0]][parts[1]].attributes.receivedTS | string | truncate(19,True,'',0),'%Y-%m-%d %H:%M:%S:%f'))) | int) > 36000 -%}
{{ states[parts[0]][parts[1]].name }} : dernière réponse le {{ states[parts[0]][parts[1]].attributes.receivedTS | string | truncate(19,True,'',0) }}.{{ '\n' }}
{%- endif -%}
{%- endfor -%}
mode: parallel
max: 10
The automation uses the devices specified in the group created with battery supplied ZWave modules :
zwave_activity:
name: Zwave dernière activité
entities:
- zwave.fibaro_system_fgdw002_door_opening_sensor_2
- zwave.fgdw002_fenetre_chambre_damis
- zwave.fgdw002_fenetre_chambre_dapolline
- zwave.fgdw002_fenetre_parentale
- zwave.fibaro_system_fgk101_door_opening_sensor
- zwave.popp_mold_detector_1
- zwave.popp_mold_detector_2
- zwave.popp_mold_chambre_d_amis
- zwave.popp_mold_salle_de_bain
I switched to ZWave-JS a few weeks ago, and now the zwave.something entities doesn’t exist anymore, so I don’t know where to find the .attribute.receivedTS info from the ZWave devices.
Where could I find it ?
Thanks