Contact us for all your questions
Alternative FIBARO push messages
Pushover messageservice | Your house will sent you messages
Fibaro's own push message system can be slow and there is no logging of messages.There is an alternative, with Pushover you can sent messages and keep a log of old messages.
- Make a pushover account via: https://pushover.net/, the User-Key is needed for the LUA code,
- Download the Pushover app from the appstore or playstore, You will get a 5-day trial for free. After that the app is about 5 euro.
You can use the data from your account on every platform.
- Make an apllication on the Pushover site an give it a name (for example FIBARO HC2 and upload a logo). Remember the API-token.
This API-token is also needed in the LUA code. U will get 7500 messages per month.
- Send a testmessage from the Pushover site to check if it works. You can select a sound per application
- The API website of Pushover will give you lots of details on the possibilities
FIBARO Home Center 2
- Make a global variable called "pushoverBody" and give it a value '0'
- Make a LUA scene based on the following code, and use the User-Key and App-key from the Pushover apllication
- Make sure that you select "Do not allow alarm to stop scene while alarm is running".
LUA-code :
This is the LUA code you need:
-------------------------------------------
--[[%%
properties
%%
globals
pushover
Body --]]
--Prevents the scene from running again when the Global pushoverBody variable get's reset to 0 the end of this scene
if (tonumber(fibaro:getGlobalValue("pushoverBody")) == 0) then
fibaro:abort();
end
local selfhttp = net.HTTPClient({timeout=2000})
local tkn = "<API_TOKEN>"
local usr = "<USR_KEY>"
local msg = fibaro:getGlobalValue("pushoverBody")
local requestBody = 'token=' ..tkn ..'&user=' ..usr ..msg --print(requestBody);
selfhttp:request('https://api.pushover.net/1/messages.json', {
options={
headers = selfhttp.controlHeaders,
data = requestBody,
method ='POST',
timeout =5000
},
success =function(status)
local result = json.decode(status.data);
print("status");
if result.status ==1 then
print("successful");
print("Request: "..result.request);
else
print("failed");
print(status.data);
end
end,
error =function(error)
print"ERROR"
print(error)
end})
--Reset the global pushoverBody variable to 0,this makes sure that when the same pushover message is send again it will change the global variable and trigger this scene.
fibaro:setGlobal("pushoverBody","0")
-------------------------------------------
- Save the LUA code.
- From (other) LUA scenes you can sent pushover messages by using this piece of LUA code.
-------------------------------------------
local dvc ="iPhone_User"
local prio ="0"
local ttl ="Alarm Armed"
local msg ="Alarm Armed"
local requestBody ='&device='..dvc ..'&priority='..prio ..'&title='..ttl ..'&message='..msg
fibaro:setGlobal("pushoverBody", requestBody)
-------------------------------------------
The example you see below sends a high priority code every 30 seconds for approx 3600 ses. until the message is aknowlegd by the app on your smartphone. The alien-message is being used and the name of the triggered scene is sent with the mess
-------------------------------------------
local startSource = fibaro:getSourceTrigger();
local prio ="2"
local rtr ="30"
local exp ="3600"
local snd ="alien"
local ttl ="!!! ALARM !!!"
local msg = fibaro:getName(startSource["deviceID"]).." Sensor ALARM !!!"local requestBody ='&priority='..prio ..'&retry='..rtr ..'&expire='..exp ..'&sound='
..snd ..'&title='..ttl ..'&message='..msg
fibaro:setGlobal("pushoverBody", requestBody)
------------------------------------------
Many thanks to the original English message by Edwin.
- Z-waveSale!Registered customer recieve benefits!Fibaro's Home Center 2 is the brain of FIBARO's Z-wave smart home system. This gateway has the best specifications and the fastest processor of all Z-wave controllers available. There is also a black version.Did you know that you can try this home center 2 before you buy it? Ask us for details and login to our demo Home Center 2. Not sure which Home Center to buy, click here.
FIBARO
Home Center 2 FIBARO
From 499.00
for 440.00
- Z-waveSale!Registered customer recieve benefits!Fibaro's Home Center 2 is the brain of FIBARO's Z-wave smart home system. This gateway has the best specifications and the fastest processor of all Z-wave controllers available. Did you know that you can try this home center 2 before you buy it? Ask us for details and login to our demo Home Center 2. Not sure which Home Center to buy, click here.
FIBARO
Home Center 2 Black FIBARO
From 594.99
for 440.00