[SOLVED] Sensor 'Check Up' for Zigbee and 433Mhz RF Devices

Hi there,

I was wondering if anyone could point me in the right direction …

I’m trying to figure out a way of provide a sort of ‘check up’ service for my Zigbee and 433Mhz sensors.

Let me try and explain … Some of these sensors (if not most) are either connected via Zigbee or 433Mhz RF. Unlike there WiFi counterparts, these do not have a ‘constant connection’ and simple ping the gateway/hub once activated or triggered. With WiFi, a device is always (hopefully) connected to a wireless network so it’s easy to determine whether its online or offline.

The solution I’m trying to come up with won’t be real-time monitoring but a ‘regular check-up’ sort of procedure. I want to determine if a sensor has been activated or triggered within a certain period of time. If it hasn’t then I can roughly determine that there is an issue with the sensor (battery dead or out of signal range) and set the status to ‘possibly offline’.

To give an example, I expect that my First Floor PIR sensor to be triggered at least a few times during the day (unless I’m on holiday) so I can create a rule to say ‘if First Floor sensor hasn’t been triggered (state changed) within 13 hours’ (in case I decide to stay in bed) then set the status to ‘possibly offline’. Make sense? Of course this requires individual rules being setup for each sensor however it is the only solution I can think of to get around the issue.

What I have so far is a binary sensor template to calculate the time of last triggering and present a result however I’m not sure this is working correctly …

    ## 433 PIR - First PIR 
      sensor_check_pir_first_no_activity:
        entity_id: sensor.time
        value_template: >
          {{ (now().timestamp() - as_timestamp(states.binary_sensor.first_hallway_motion.last_changed)) | int //60 > 780 }} 

Once I’ve got all my sensors setup I’ll be able to setup another sensor to group and show how many have not ‘checked in’ or possibly offline. That part I’ve got sorted already, its just this initial check I need a hand with

[SOLVED] - Documented on my recent post: https://blog.swakes.co.uk/home-assistant-system-dashboard/