Pushover notification scripting - Printable Version +- Logic Machine Forum (https://forum.logicmachine.net) +-- Forum: LogicMachine eco-system (https://forum.logicmachine.net/forumdisplay.php?fid=1) +--- Forum: Scripting (https://forum.logicmachine.net/forumdisplay.php?fid=8) +--- Thread: Pushover notification scripting (/showthread.php?tid=391) |
Pushover notification scripting - Jørn - 18.09.2016 Hi everybody, i need some help with the Pushover script. Everything is set up and working great, but my issue is that the script runs regardless of the value of the KNX object. I would i.e. like it to run only when the object is set to "1" or "0", and possibly when over or under a certain value (if for example a temperature climbs below or over a set point). It's easy to make this happen with logic functions on my KNX devices, but i would rather keep it all in the LM5. My lua programming skills are equal to zero RE: Pushover notification scripting - Erwin van der Zwart - 18.09.2016 Hi, Use this in your event based script: value = event.getvalue() if value == true then -- or use =< 21 -- put here your push command elseif value == false then -- or use => 22 -- put here your action / command end BR, Erwin RE: Pushover notification scripting - Jørn - 18.09.2016 (18.09.2016, 11:37)Erwin van der Zwart Wrote: Hi, Wow, thanks alot Erwin, i've spent hours on this. And now i see i tried to overcomplicate it. Works as inteded now Best regards RE: Pushover notification scripting - Jørn - 25.10.2016 (18.09.2016, 11:37)Erwin van der Zwart Wrote: Hi, Hi again Erwin, another problem arose when i started using this for real. I get an alert every time the bus get's updated with a lower value than set. What would i need to add in the script to make it check previous value, and not to run the script if previous value already led it to run the script`? BR, Jørn RE: Pushover notification scripting - Erwin van der Zwart - 25.10.2016 Hi Jørn, Use this: Code: value = event.getvalue() BR, Erwin RE: Pushover notification scripting - Jørn - 26.10.2016 (25.10.2016, 21:38)Erwin van der Zwart Wrote: Hi Jørn, Thanks, i had to hack it somewhat to make it to work, resulted in this; Code: value = event.getvalue() In this instant used to alert when temperature outside gets close to freezing. Maybe a little messy, but it does the job I was not able to save the script with "end" after storage.set , but it seems to be working.' Edit; To make it work, i have to run a script first with only getvalue and storage.set, to make it write a value to storage. If not, the script get stopped before getting to store the value (error; attempt to compare number with nil). Workarounds to avoid this`? RE: Pushover notification scripting - jetsetter - 28.12.2016 Hi, I have set up and used the pushover script according to the example given by Erwin (thank you for this), but I cannot see how I can select which device the message should be delivered to. So far I have downloaded and registered the mobile app in my phone and my wife's phone, but the messages are broadcasted to both phones. In the pushover website, you can choose to send a test notification by choosing a specific registered device or all the registered devices (broadcast). Is there another script that allows to select to which device the notification is send to? Thank you in advance. EDIT: I have seen in pushover API documentation that I can include in the sending url another optional field called "device" which is what I was looking for, so I will try this to see. I propose for Erwin to edit his original example in order to include this field as I found it very useful. RE: Pushover notification scripting - buuuudzik - 28.12.2016 And there is also a possibility to create specific groups and use their token instead the user token. Pushover Groups API RE: Pushover notification scripting - jetsetter - 29.12.2016 (28.12.2016, 21:59)buuuudzik Wrote: And there is also a possibility to create specific groups and use their token instead the user token. thank you buuuudzik! RE: Pushover notification scripting - buuuudzik - 30.12.2016 You're welcome RE: Pushover notification scripting - FatMax - 09.04.2017 I have played around a bit with Pushovers Glances API for the Apple Watch. It´s currently in Beta. They specifically ask you not to send more than 1 update to the Glances API every 20 minutes, because of the way that Apple handles battery efficiency on the Apple Watch. It seems to work reliably though, except if you do not open the main app on your iPhone every 2 days. I suppose this is because of the lack of background tasking in iOS. Create a new user library, user.glances : Code: require 'ssl.https' This script handles info sent to the Glances API, specified by you: Code: --Glances-script I´m sure this code can be cleaned up some, but just wanted to post it so other people can try it out. |