TTN over webhook to Pushover for Water-leak-Sensor

Hello everyone,

I would like to integrate a DRAGINO LWL02-EU868 water leak sensor and receive notifications via Pushover. We often have storms and flooded basements here.

The sensor sends various status messages:

  • Water leak event

  • Keep-alive message (once daily)

  • Periodic updates during a water leak (every 10 minutes)

  • Switch from water leak to no water leak

  • Battery status included in the payload

I have successfully integrated the sensor into the TTN network.

{
“BAT_V”: 2.742,
“LAST_WATER_LEAK_DURATION”: 0,
“MOD”: 2,
“WATER_LEAK_STATUS”: 0,
“WATER_LEAK_TIMES”: 0
}

As far as I understand, Pushover is connected via a webhook.
I have created a Pushover account and API key.

Unfortunately, I am stuck configuring the webhook in TTN.
Webhook as POST to Pushover-API Adress is: https://api.pushover.net/1/messages.json
and the Payload form Webhook must have token, user and message.

token=DEIN_PUSHOVER_API_TOKEN&
user=DEIN_1_USER_KEY&
message=Wasserleck Alarm von Sensor {{device_id}}: Status {{payload_fields.status}}, Batterie {{payload_fields.battery}}

But i dont know where in the webhook i have to define the Payload.

I have searched extensively online and in the forum without success.

Is there a how-to or guide? Or does someone have a sensor with a similar configuration that could help me?

Thank you in advance!


You cannot use the HTTP webhook provided by TTN to directly drive a service that requires a different format json message like Pushover. You will need to use an intermediate server (or service) to translate from one format to the other.

One way to achieve this is to use node-red. (If you google free node red hosting you might get some pointers) There are other ways but each one involves you setting something up to do the translation on a server outside TTN.

1 Like