How to set up an automation for Z-Wave 'last seen'

I have a Z-Wave window sensor that sometimes disappears off the Z-Wave network. I’d like to create an automation that checks the ‘last seen’ value for that sensor, but that doesn’t seem to be one of the options in the UI.

How can I do that?

Use a template trigger. Try this in your Developer tools > Template

{{ (utcnow() | as_timestamp - states('sensor.christmas_arch_last_seen')| as_timestamp) | int(0) }}

Substitute the name of your device’s last seen entity between the single quotes.

This should give you the number of seconds since the device’s last seen time and now.
If that looks good, go to Automations + CREATE AUTOMATION, Create new automation.
Click Add Trigger
Type template in search trigger
Select Template from the search results
Enter a template similar to the above developers test with > some value

 {{ (utcnow() | as_timestamp - states('sensor.christmas_arch_last_seen')| as_timestamp) | int(0) > 43200 }}

The above example will trigger 12 hours after the last seen timestamp of the device.

That gets you past your “checks the last seen” trigger requirement. Good luck!

Thanks! That helped a lot!