Hi all,
I'm trying to use notifications on an alert (dummy) to send myself a Pushover message.
This alert is activated via MQTT. I'm able to trigger the alert and the set Pushover action using the sensor but am struggling with the content of the message itself. I found that $value in the 'custom message' field returns me the state of the alert - 0/1/2/3/ etc. but not the text itself inside of my received Pushover message. What is the variable to use for this text?
Thanks in advance.
Best regards,
Sandolution
Custom Message in Notifications
Moderators: leecollings, remb0
-
- Posts: 2
- Joined: Wednesday 02 August 2017 21:12
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Contact:
- waaren
- Posts: 6028
- Joined: Tuesday 03 January 2017 14:18
- Target OS: Linux
- Domoticz version: Beta
- Location: Netherlands
- Contact:
Re: Custom Message in Notifications
Only variables I can see in see in source are $value and $name. You can use a small dzVents scripts to achieve your goal.Sandolution wrote: ↑Friday 19 July 2019 23:54 I'm trying to use notifications on an alert (dummy) to send myself a Pushover message.
Code: Select all
return
{
on = { devices = { "Alert name" }},
execute = function(dz, item)
dz.log("alert level: " .. item.color)
dz.log("alert text: " ..item.text)
if item.color > dz.ALERTLEVEL_GREEN then
dz.notify("Alert",item.text,(item.color - 2),nil,nil,dz.NSS_PUSHOVER)
end
end
}
"In Domoticz go to Setup > Settings > Other and in the section EventSystem make sure the checkbox 'dzVents disabled' is not checked. Also make sure that in the Security section in the settings you allow 127.0.0.1 to not need a password. dzVents uses that port to send certain commands to Domoticz. Finally make sure you have set your current location in Setup > Settings > System > Location, otherwise there is no way to determine nighttime/daytime state."
Debian buster, bullseye on RPI-4, Intel NUC.
dz Beta, Z-Wave, RFLink, RFXtrx433e, P1, Youless, Hue, Yeelight, Xiaomi, MQTT
==>> dzVents wiki
dz Beta, Z-Wave, RFLink, RFXtrx433e, P1, Youless, Hue, Yeelight, Xiaomi, MQTT
==>> dzVents wiki
-
- Posts: 2
- Joined: Wednesday 02 August 2017 21:12
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Contact:
Re: Custom Message in Notifications
Thanks Waaren, that was exactly the functionality I was looking for.
Code has become a bit easier, monitoring the actual item text:
Thanks again for the help.
Code has become a bit easier, monitoring the actual item text:
Code: Select all
return
{
on = {
devices = {
"[DU] Pushover Alarm"
}
},
execute = function(dz, item)
if item.text > ' ' then
dz.notify("Alarm",item.text,dz.PRIORITY_HIGH,nil,nil,dz.NSS_PUSHOVER)
end
end
}
Who is online
Users browsing this forum: No registered users and 1 guest