blackscreener

SMS z Domoticz

May 7th, 2019
248
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.91 KB | None | 0 0
  1. commandArray = {}
  2. stan = tostring (otherdevices['Burze - Ostrzeżenie o upale'])
  3. info=string.gsub (tostring(stan), " ", "+")
  4.  
  5. if (info == 'Brak+ostrzeżeń') then
  6.     info = 'Brak%20ostrze%C5%BCe%C5%84'
  7. end
  8.  
  9. if (otherdevices['Burze - Ostrzeżenie o upale'] ~= 'Brak ostrzeżeń' and uservariables["upał"] == 0) then
  10.     os.execute ('curl "https://platform.clickatell.com/messages/http/send?apiKey=API&to=TEL&content=Alert+z+domu:+"'..info)
  11.     commandArray['Variable:upał'] = '1'
  12.     print "SMS z alertem wysłany - upał"
  13.     print (info)
  14. elseif (otherdevices['Burze - Ostrzeżenie o upale'] == 'Brak ostrzeżeń' and uservariables["upał"] == 1) then
  15.     os.execute ('curl "https://platform.clickatell.com/messages/http/send?apiKey=API&to=TEL&content=Alert+o+upale:+"'..info)
  16.     commandArray['Variable:upał'] = '0'
  17.     print "SMS z alertem wysłany - odwołano alert przed upałem"
  18. end
  19.  
  20. return commandArray
Advertisement
Add Comment
Please, Sign In to add comment