How to trigger an event if no mqtt messages in a period of time

Hello all,

I hope someone here can steer me in the right direction. I am trying to figure out how to trigger an event when I haven’t heard from one of my mqtt devices in a while. I’m new to many parts of HA and am not sure where to look for information.

Thanks for any assistance/suggestions you all have.

Go the pull over menu on the left and click on the services icon at the bottom left.

In the drop-down menu select “mqtt.publish”. Edit the example JSON to your info then click “call service”.

I would also open a MQTT sniffer program (MQTTFx or such) and subscribe to all topics (#) to make sure the message was actually sent and then see any replies.

Whether it works or not depends on where you go from there.

I don’t use MQTT, but if by “one of my mqtt devices” you mean a single HA entity, or even maybe a few, you could use a timer. Have an automation with a state trigger and enter the entity_id of the device (or list of entity_id’s that correspond to the device.) Then in the action start the timer. Have another automation that is triggered by the timer finishing and put whatever you want in the action part. Let me know if you think this will do what you want and if you need any help getting it working.