Last active
July 29, 2017 23:56
-
-
Save pmcgn/4f366cb104a760e9e477737269f52424 to your computer and use it in GitHub Desktop.
Homematic Script: Send Push Notifications via pushover
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
!Pushover | |
!------------------------------ | |
!__Pushover Keys | |
string po_api_user="paste-secret-here"; | |
string po_api_token="paste-secret-here"; | |
!__Nachricht | |
string po_title="Nachrichtentitel"; | |
string po_message="Nachrichteninhalt"; | |
string po_sound="none"; | |
string po_priority="0"; | |
!___Nur benoetigt wenn Prioritaet auf Emergency (2) gesetzt ist | |
string po_retry="30"; | |
string po_expires="3600"; | |
!___Erlaeuterungen | |
! Sounds: pushover, bike, bugle, cashregister, classical, cosmic, falling, gamelan, incoming, intermission, magic, mechanical, pianobar, siren, spacealarm, tugboat, alien, climb, persistent, echo, updown, none | |
!Prioritaeten: 0=Normal; 1=High (AudioVibration auch waehrend quiet hour); 2=Emergency (Meldung Muss bestätigt werden, solange sound/Vibration); -1=Low ; -2=Lowest | |
! Bei Prio 2: po_retry gibt an (in sekunden), wie hauefig eine Nachricht vom Server geschickt wird (z.B. alle 30s) | |
! Bei Prio 2: po_expires gibt an (in sekunden), wie lange nachrichten geschickt werden sollen. Bestätigt der User, stoppt die Benachrichtigung. Beispiel: Alle 30 sekunden wird eine Nachricht geschickt, das passiert eine Stunde lang (1 Stunde = 3600 sekunden). | |
!------ NICHT MODIFIZIEREN------- | |
string po_request; | |
if(po_priority=="2"){ | |
po_request="/usr/local/addons/cuxd/curl -X POST -k -H \"Content-Type: application/x-www-form-urlencoded\" -d \"token=" # po_api_token # "&user=" # po_api_user # "&title=" # po_title # "&priority="# po_priority # "&sound=" # po_sound # "&retry="# po_retry # "&expire=" # po_expires # "&message=" # po_message # "\" https://api.pushover.net/1/messages.json"; | |
Write("2"); | |
} | |
else{ | |
po_request="/usr/local/addons/cuxd/curl -X POST -k -H \"Content-Type: application/x-www-form-urlencoded\" -d \"token=" # po_api_token # "&user=" # po_api_user # "&title=" # po_title # "&priority="# po_priority # "&sound=" # po_sound # "&message=" # po_message # "\" https://api.pushover.net/1/messages.json"; | |
Write("1"); | |
} | |
Write(po_request); | |
dom.GetObject("CUxD.CUX2801001:1.CMD_EXEC").State(po_request); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment