Notification (using PushOver)
Moderator: leecollings
-
- Posts: 24
- Joined: Wednesday 20 September 2017 15:24
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Contact:
Notification (using PushOver)
I have been Googling for a long time, and I see everyone writing about it very casually. So I suppose it's something really easy... But I just can't fgure it out...
In Domoticz settings I've set up Pushover notifactions using API-key and password. When I press the test button it works fine! It also works fine when adding a notification to a specific device. But I want to use it in a LUA script...
Now I understood all I had to do was add the follwing to a LUA script and it should work:
commandArray['SendNotification']='notificationmessage'
But it doesn't. I don't get any notifcations, neither do I see any errors in the log...
Am I missing something here? Is there something else I should set-up??
(p.s. a notification through the Domoticz app would be even better... but I understood this isn't working anymore?)
In Domoticz settings I've set up Pushover notifactions using API-key and password. When I press the test button it works fine! It also works fine when adding a notification to a specific device. But I want to use it in a LUA script...
Now I understood all I had to do was add the follwing to a LUA script and it should work:
commandArray['SendNotification']='notificationmessage'
But it doesn't. I don't get any notifcations, neither do I see any errors in the log...
Am I missing something here? Is there something else I should set-up??
(p.s. a notification through the Domoticz app would be even better... but I understood this isn't working anymore?)
- waaren
- Posts: 6028
- Joined: Tuesday 03 January 2017 14:18
- Target OS: Linux
- Domoticz version: Beta
- Location: Netherlands
- Contact:
Re: Notification (using PushOver)
The command does look OK Can you include the complete script as there might be something else influencing the behaviour ?Kasvand wrote: ↑Saturday 07 September 2019 11:26 In Domoticz settings I've set up Pushover notifactions using API-key and password. When I press the test button it works fine! It also works fine when adding a notification to a specific device. But I want to use it in a LUA script...
(p.s. a notification through the Domoticz app would be even better... but I understood this isn't working anymore?)
GCM notification is available in recent Beta's
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: 24
- Joined: Wednesday 20 September 2017 15:24
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Contact:
Re: Notification (using PushOver)
Nevermind... Had a thinking error in my script. Thought it was caused by the notification script not working. My bad
Thanks for informing me the actual code was ok..
Thanks for informing me the actual code was ok..
-
- Posts: 24
- Joined: Wednesday 20 September 2017 15:24
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Contact:
Re: Notification (using PushOver)
ANother issue I now find when testing.
I have the following command
I expected this to be emergency priority (and thus showing red in the app and playing sound even though the sound on the phone is dimmed (which I've set in the app... WOrks great when sending a notification through a device with emergency prioity).
But it only shows a normal priority message...? Why? (and why isn't there any documentation on this functionality! :/
I have the following command
Code: Select all
commandArray['SendNotification']='Voordeur#De voordeur is geopend##2##'
But it only shows a normal priority message...? Why? (and why isn't there any documentation on this functionality! :/
- waaren
- Posts: 6028
- Joined: Tuesday 03 January 2017 14:18
- Target OS: Linux
- Domoticz version: Beta
- Location: Netherlands
- Contact:
Re: Notification (using PushOver)
Did you try this ?
Domoticz is an open source project. This means that code, support and documentation are created and maintained by people for free in their spare time. That is also true for all information in the many wiki pages. So if you find something missing in this area and find out how it's done, either by support from others or finding howto by trial and error, you can help yourself and others a lot by creating or updating the documentation / wiki's.
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: 24
- Joined: Wednesday 20 September 2017 15:24
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Contact:
Re: Notification (using PushOver)
Of course I tried thatwaaren wrote: ↑Sunday 08 September 2019 23:19Did you try this ?
Domoticz is an open source project. This means that code, support and documentation are created and maintained by people for free in their spare time. That is also true for all information in the many wiki pages. So if you find something missing in this area and find out how it's done, either by support from others or finding howto by trial and error, you can help yourself and others a lot by creating or updating the documentation / wiki's.

Ha! I just found somewhere else on the wiki another implementation of the notification which does work!
On the events page it's said it works like this: commandArray['SendNotification']='subject#body#extraData#priority#sound#subsystem
Somewhere else it's mentioned like this: commandArray['SendNotification']='subject#body#0'
That last one actually works! Could it be that the first one is for the latest and greatest version? (I haven't yet had the time to update my Domoticz...still on version 4.9700). Anyone with a newer version willing to try this out? If so, I can mention this on a wiki page to prevent others from running into this issue...
-
- Posts: 132
- Joined: Monday 07 August 2017 17:17
- Target OS: Linux
- Domoticz version: Latest β
- Location: Near London (Saaarf!)
- Contact:
Re: Notification (using PushOver)
I know that this doesn't actually use the included 'Sendnotification' function but as a method it works well for me
Call the function with:
Execute function with:
Call the function with:
Code: Select all
pushovernotify("0","Domoticz","message","1","my_phone")(
Code: Select all
--Send Pushover notification to a particular device
function pushovernotify(Priority, Title, Body, Sound, Device)
-- Priority = -2,-1,0,1,2
-- Device = name of device, empty is all
-- Check for optional sound and device parameter
if Title == nil then Title = '' end
if Sound == nil then Sound = '' end
if Device == nil then Device = '' end
local UserKey = <PUSHOVER_USERKEY>'
local Token = '<PUSHOVER_USERTOKEN>'
local Msg = 'curl --data "token=' .. Token .. '&user=' .. UserKey .. '&title=' .. Title .. '&message=' .. Body .. '&priority=' .. tostring(Priority) .. '&sound=' .. Sound .. '&device=' .. Device .. '" https://api.pushover.net/1/messages.json'
os.execute(Msg)
end
Domoticz Latest β, RPi 4B with 110Gb SSD for Domoticz, RPi 4B with 110Gb SSD for Node-Red & a RPi 2B for logging / IP addressing. RFXCOM, PiZiGate, Z-Wave, Harmony, Hue lamps and a bit of Broadlink.
- waaren
- Posts: 6028
- Joined: Tuesday 03 January 2017 14:18
- Target OS: Linux
- Domoticz version: Beta
- Location: Netherlands
- Contact:
Re: Notification (using PushOver)
First descriptions is not completely accurate. It must be commandArray['SendNotification']='subject#body#priority#sound#extraData#subsystem(s)Kasvand wrote: ↑Monday 09 September 2019 10:42 Ha! I just found somewhere else on the wiki another implementation of the notification which does work!
On the events page it's said it works like this: commandArray['SendNotification']='subject#body#extraData#priority#sound#subsystem
Somewhere else it's mentioned like this: commandArray['SendNotification']='subject#body#0'
That last one actually works!
I corrected this just now on the wiki page.
Try this Lua code (saved as time triggered)
Code: Select all
--[[
SendNotification = commandArray[#commandArray + 1] = { SendNotification = 'subject#body#prio#sound#extraData#subSystem1;subSystem2;subSystem'3
subject = string ==>> required
body = string ==>> required
pri = number ==>> optional (-2,-1,0,1,2 = low, moderate, normal, high, emergency) default normal
sound = string ==>> optional (examples: bike, magic, siren )
extraData => string ==>> optional
subSystem ==> string ==>> optional (examples: pushover, pushover;pushsafer;telegram, gcm ) default All defined subsystems
]]--
commandArray = {}
commandArray[#commandArray + 1] = { SendNotification = 'test2One#test2One#0#siren##pushover'}
commandArray[#commandArray + 1] = { SendNotification = 'test2AllSubject#test2AllBody'}
commandArray[#commandArray + 1] = { SendNotification = 'test2Two#test2Two#1###pushover;pushsafer'}
return commandArray
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
- waaren
- Posts: 6028
- Joined: Tuesday 03 January 2017 14:18
- Target OS: Linux
- Domoticz version: Beta
- Location: Netherlands
- Contact:
Re: Notification (using PushOver)
The risc of using curl directly in an event script is that you block the entire event system for the duration of the call. When calling an external site, the curl as used here will wait until the remote site have replied. It is safer to use the internal domoticz commands and when the command you need is not available then at least execute the command in the background by adding an ' &' to it or set a maxtime parameter.alanlsmith wrote: ↑Monday 09 September 2019 15:04 I know that this doesn't actually use the included 'Sendnotification' function but as a method it works well for me
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: 132
- Joined: Monday 07 August 2017 17:17
- Target OS: Linux
- Domoticz version: Latest β
- Location: Near London (Saaarf!)
- Contact:
Re: Notification (using PushOver)
You are quite correct, I should have mentioned that. Although in my experience the Pushover API calls are handled in a negligible amount of time.
It also allows for sending a notification to a specific device.
Domoticz Latest β, RPi 4B with 110Gb SSD for Domoticz, RPi 4B with 110Gb SSD for Node-Red & a RPi 2B for logging / IP addressing. RFXCOM, PiZiGate, Z-Wave, Harmony, Hue lamps and a bit of Broadlink.
-
- Posts: 24
- Joined: Wednesday 20 September 2017 15:24
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Contact:
Re: Notification (using PushOver)
Thanks! I'm going to do some experimenting with this soon. When I feel I totally understand what's happening I will create a Wiki page on the SendNotification functionality (if it's still not present) and might also post something about it on my Smart Home blog! I think this is something every Domoticz user should understand and usewaaren wrote: ↑Monday 09 September 2019 16:17First descriptions is not completely accurate. It must be commandArray['SendNotification']='subject#body#priority#sound#extraData#subsystem(s)Kasvand wrote: ↑Monday 09 September 2019 10:42 Ha! I just found somewhere else on the wiki another implementation of the notification which does work!
On the events page it's said it works like this: commandArray['SendNotification']='subject#body#extraData#priority#sound#subsystem
Somewhere else it's mentioned like this: commandArray['SendNotification']='subject#body#0'
That last one actually works!
I corrected this just now on the wiki page.
Try this Lua code (saved as time triggered)Code: Select all
--[[ SendNotification = commandArray[#commandArray + 1] = { SendNotification = 'subject#body#prio#sound#extraData#subSystem1;subSystem2;subSystem'3 subject = string ==>> required body = string ==>> required pri = number ==>> optional (-2,-1,0,1,2 = low, moderate, normal, high, emergency) default normal sound = string ==>> optional (examples: bike, magic, siren ) extraData => string ==>> optional subSystem ==> string ==>> optional (examples: pushover, pushover;pushsafer;telegram, gcm ) default All defined subsystems ]]-- commandArray = {} commandArray[#commandArray + 1] = { SendNotification = 'test2One#test2One#0#siren##pushover'} commandArray[#commandArray + 1] = { SendNotification = 'test2AllSubject#test2AllBody'} commandArray[#commandArray + 1] = { SendNotification = 'test2Two#test2Two#1###pushover;pushsafer'} return commandArray

- waaren
- Posts: 6028
- Joined: Tuesday 03 January 2017 14:18
- Target OS: Linux
- Domoticz version: Beta
- Location: Netherlands
- Contact:
Re: Notification (using PushOver)
If you do that then please also consider to add a link to the domoticz notify method wiki text to this new page. This dzVents notify method hide the technical nitty gritty and simplify the use of this domoticz functionality. You can find how dzVents does this in <domoticz>/dzVents/runtime/Domoticz.lua starting around line 255Kasvand wrote: ↑Monday 09 September 2019 18:22 I'm going to do some experimenting with this soon. When I feel I totally understand what's happening I will create a Wiki page on the SendNotification functionality (if it's still not present) and might also post something about it on my Smart Home blog! I think this is something every Domoticz user should understand and use![]()
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: 24
- Joined: Wednesday 20 September 2017 15:24
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Contact:
Re: Notification (using PushOver)
Made a start with a Wiki page. Feel free to update/add info! It's far from complete nor is it perfect. But it's a start...
https://www.domoticz.com/wiki/SendNotification
https://www.domoticz.com/wiki/SendNotification
-
- Posts: 132
- Joined: Monday 07 August 2017 17:17
- Target OS: Linux
- Domoticz version: Latest β
- Location: Near London (Saaarf!)
- Contact:
Re: Notification (using PushOver)
@waarren
I've just realised that in the 'Sendnotification' method the 'extradata' can be used to specify the device.
So in future I shall use that rather than curl.
Thanks for pointing me in the right direction.
@Kasvand
I've added reference to this to the Wiki page. Well done for creating it.
I've just realised that in the 'Sendnotification' method the 'extradata' can be used to specify the device.
So in future I shall use that rather than curl.
Thanks for pointing me in the right direction.
@Kasvand
I've added reference to this to the Wiki page. Well done for creating it.
Domoticz Latest β, RPi 4B with 110Gb SSD for Domoticz, RPi 4B with 110Gb SSD for Node-Red & a RPi 2B for logging / IP addressing. RFXCOM, PiZiGate, Z-Wave, Harmony, Hue lamps and a bit of Broadlink.
- waaren
- Posts: 6028
- Joined: Tuesday 03 January 2017 14:18
- Target OS: Linux
- Domoticz version: Beta
- Location: Netherlands
- Contact:
Re: Notification (using PushOver)
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
Who is online
Users browsing this forum: No registered users and 1 guest