DzVents and PushSafer - need help getting it to work
Posted: Tuesday 11 December 2018 11:54
Friends,
I am trying to get PushSafer to send a push message to my iPhone.
The http syntax i use is OK, as i can end that message from a browser from the RPi and the notification shows up at my phone.
trying to send that message from DzVents does not yied an error from DzVents, but the message never shows up at my phone
DzVents code i "wrote/cobbled together"
The Domoticz log with DzVents at most verbose level yields
I do not see any obvious errors, but since there is no notification received, something must be wrong.
I have tried sending the same http string from the RPi browser, and that yields a notification on my phone, so technically it works from the RPi.
I suspect the issue to be in my DzVents code, but as a LUA newbie i i am not to familiar with the syntax.
Did anybody try this already and got it to work? I am grateful for any advice that may help me get this working.
thanks for reading,
Rob
I am trying to get PushSafer to send a push message to my iPhone.
The http syntax i use is OK, as i can end that message from a browser from the RPi and the notification shows up at my phone.
trying to send that message from DzVents does not yied an error from DzVents, but the message never shows up at my phone
DzVents code i "wrote/cobbled together"
Code: Select all
-- Test event to see if pushsafer can be done from DzEvents
return {
on = {
timer = { 'every 5 minutes' },
httpResponses = { 'MsgSent' }
},
execute = function(domoticz, device)
if (device.isTimer) then
domoticz.openURL(
{
url = 'https://www.pushsafer.com/api?k=####################&d=#####&i=173&v=3&pr=0&a=1&t=Message from DzEvents&m=Zet je fiets aan de lader',
method = 'POST',
callback = 'MsgSent'
}
)
end
if (device.isHTTPResponse) then
if (device.ok) then
domoticz.log('HTTP POST message TBC was sent', domoticz.LOG_INFO)
else
domoticz.log('device.ok was not on', domoticz.LOG_INFO)
end
end
end
}
Code: Select all
2018-12-11 11:30:00.467 Status: dzVents: Info: ------ Start internal script: SndNotTest:, trigger: every 5 minutes
2018-12-11 11:30:00.469 Status: dzVents: Debug: OpenURL: url = https://www.pushsafer.com/api?k=####################&d=####&i=173&v=3&pr=0&a=1&t=Message from DzEvents&m=Zet je fiets aan de lader
2018-12-11 11:30:00.469 Status: dzVents: Debug: OpenURL: method = POST
2018-12-11 11:30:00.469 Status: dzVents: Debug: OpenURL: post data =
2018-12-11 11:30:00.469 Status: dzVents: Debug: OpenURL: headers = nil
2018-12-11 11:30:00.469 Status: dzVents: Debug: OpenURL: callback = MsgSent
2018-12-11 11:30:00.469 Status: dzVents: Info: ------ Finished SndNotTest
2018-12-11 11:30:00.469 Status: dzVents: Debug: Commands sent to Domoticz:
2018-12-11 11:30:00.470 Status: dzVents: Debug: - OpenURL = {["method"]="POST", ["URL"]="https://www.pushsafer.com/api?k=####################&d=####&i=173&v=3&pr=0&a=1&t=Message from DzEvents&m=Zet je fiets aan de lader", ["_trigger"]="MsgSent", ["postdata"]=""}
2018-12-11 11:30:00.470 Status: dzVents: Debug: =====================================================
I have tried sending the same http string from the RPi browser, and that yields a notification on my phone, so technically it works from the RPi.
I suspect the issue to be in my DzVents code, but as a LUA newbie i i am not to familiar with the syntax.
Did anybody try this already and got it to work? I am grateful for any advice that may help me get this working.
thanks for reading,
Rob