Notification with text sensor value

Moderator: leecollings

Post Reply
dheuts
Posts: 65
Joined: Monday 25 March 2019 15:14
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: Brunssum, Netherlands
Contact:

Notification with text sensor value

Post by dheuts »

Good afternoon,

I made a script to put a message in a text sensor from P2000.
If the text sensor gets updated with new text, I would like to receive a notification with the content/value of the text sensor on my phone.
Test.png
Test.png (9.02 KiB) Viewed 1235 times
When I do this with Blockly and put the text sensor in the message block, I get a notification on Telegram with the text: utilitydevice3242, instead of the value of the sensor. Any idea how to get this working?

Help would be appreciated, thanks!
Raspberry Pi 4 With Domoticz - RFXCom - Tuya Wifi LED lights - Chuango Alarm - Zwave+ - Zigbee2MQTT - Anna Thermostat - Broadlink IR, P1 - Eufy Robo Vacuum - Worx Robo Mower
dheuts
Posts: 65
Joined: Monday 25 March 2019 15:14
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: Brunssum, Netherlands
Contact:

Re: Notification with text sensor value

Post by dheuts »

Nobody any idea how to get this working?
If it's not possible with Blockly, would it be possible with another kind of script?
Raspberry Pi 4 With Domoticz - RFXCom - Tuya Wifi LED lights - Chuango Alarm - Zwave+ - Zigbee2MQTT - Anna Thermostat - Broadlink IR, P1 - Eufy Robo Vacuum - Worx Robo Mower
User avatar
user4563
Posts: 110
Joined: Tuesday 19 October 2021 17:24
Target OS: Linux
Domoticz version: 2025.1
Contact:

Re: Notification with text sensor value

Post by user4563 »

It would be easiest in dzVents. For example, you can put values of sensors in the notification like this:

domoticz.notify('Front door','low battery '..domoticz.devices('Front door').batteryLevel..'%',domoticz.PRIORITY_NORMAL)

If my front door sensor had a battery level of 30%, it would send: Front door low battery 30%.

You would quote around your text, and two periods around the data. You'll just need to figure out the device object where the data you want is:
https://www.domoticz.com/wiki/DzVents:_ ... _scripting
ODroid H4+ / Ubuntu server 24.04 LTS
Aeotec Z-Stick Gen5+
ZWave-JS-UI / Mosquitto MQTT
Domoticz for Android
Domoticz Scenes add-on in Kodi
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest