Triggering on payload contents
Posted: Sat Apr 01, 2023 10:04 am
I wish to monitor my wireless sprinkler system to be sure no watering events are missed. The key to this is the sprinkler controller that sends a MQTT message at the start and end of each session. I would like to trigger on the end-of-session messages and use them to reset a timer. Then, if the timer ever runs down, I will know I have a problem.
The question is, how do I trigger on an MQTT payload rather than the topic? For example, here is a typical end of session message:
I know I can read the last_payload from the MQTT Connector in a script and reset the timer that way. But, I was wondering if there is a way to do this just using the MQTT plugins.
TIA
The question is, how do I trigger on an MQTT payload rather than the topic? For example, here is a typical end of session message:
- Code: Select all
cm/LinkTap2/up/0C928728004B1200 {"cmd":7,"gw_id":"27D88728004B1200","dev_stat":{"dev_id":"0C928728004B1200","plan_mode":0,"plan_sn":0,"is_rf_linked":true,"is_flm_plugin":true,"is_fall":false,"is_broken":false,"is_cutoff":false,"is_leak":false,"is_clog":false,"signal":83,"battery":100,"child_lock":0,"is_manual_mode":false,"is_watering":false,"is_final":false,"total_duration":0,"remain_duration":0,"speed":0.00,"volume":0.00,"volume_limit":0.00,"failsafe_duration":0}}
I know I can read the last_payload from the MQTT Connector in a script and reset the timer that way. But, I was wondering if there is a way to do this just using the MQTT plugins.
TIA