AMR2MQTT to monitor water meter

High all. I am a new user. Late last year I installed HA on a RPI5 to automate car charging wrt. solar production. Yesterday I bought a rtl-sdr device and set it up with AMR2MQTT. I am able to see my water usage and various flags from the Neptune R900i Meter. It took me about 8 hours over two days to get it working! Mostly because doing things on HA is very tedious and hard to figure out. I was this close to switching to Linux and get it running in minutes. I stuck with it and got it working. Now I am here to thank people who help maintain/improve HA.

But I am also here to vent. Having gotten the AMR2MQTT configured and working I struggled for 30 minutes to create an automation to send me a notification when the water leak flag from the meter has been ‘1’ for 12 hours. I keep getting an error:

“Message malformed: must contain at least one of below, above.”

What ‘message’ is it referring to? Nothing in the automation configuration is called a message. So total head scratcher for me.

I am using the visual editor for everything and selecting a state and setting a duration criteria. On ‘save’ I get the above error. I tried saying the flag is above 0, but that does work either (using yaml editor). I am not clear which item this error is referring to either. It would have been nice if the error message specified what ‘message’ it is referring to.

I would like to accomplish the same thing with the Leak flag. However, I am using rtlamr2mqtt ver 2.3.4. Developer tools\Statistics\sensor.meter_water provides this:

Attributes

Message Type R900
ID ***************
Unkn1 163
NoUse 32
BackFlow 0
Consumption 1,024,939
Unkn3 0
Leak 2
LeakNow 0

Your error must be related to “message type”.

My output from the R900 looks like this:
[2024-07-28 13:30:04] > payload => {“Time”: “2024-07-28T13:30:04.917971602-04:00”, “Offset”: 0, “Length”: 0, “Type”: “R900”, “Message”: {“ID”: **********, “Unkn1”: 163, “NoUse”: 0, “BackFlow”: 0, “Consumption”: 4097307, “Unkn3”: 0, “Leak”: 1, “LeakNow”: 0}}

I am kinda new to this community as well and would like to know how to extract the leak flag and create a notification if a leak is sensed. I will be watching your thread.