God kveld!
Jeg har testet ut litt custom notifications og mulighet for “widget” for glance for Apple Watch via pushover.net
What is Pushover and how do I use it?
In short, Pushover is a service to receive instant push notifications on your phone or tablet from a variety of sources
Det jeg har testet er å sende notifikasjoner direkte fra tpflow & via NodeRED.
Legger ved noen eksempler:
(har bare brukt en virtuell bryter for testing, det er HTTP msg nodene som teller)
{
"Id": "jzPwjOYPzUTdn7m",
"ClassId": "jzPwjOYPzUTdn7m",
"Author": "espenh.no",
"Version": 1,
"CreatedAt": "2021-10-03T19:11:55.819534815+02:00",
"UpdatedAt": "2021-10-03T19:19:05.494796214+02:00",
"Name": "TestNotification",
"Group": "pushover",
"Description": "TestNotification",
"Nodes": [
{
"Id": "6",
"Type": "trigger",
"Label": "TestTrigger from virtual_button ch_4",
"Address": "pt:j1/mt:evt/rt:dev/rn:flow/ad:1/sv:out_bin_switch/ad:fUCV02RUluIwMdT_4",
"Service": "out_bin_switch",
"ServiceInterface": "evt.binary.report",
"SuccessTransition": "8",
"ErrorTransition": "",
"Config": {
"Timeout": 0,
"VirtualServiceGroup": "ch_0",
"VirtualServiceProps": {},
"RegisterAsVirtualService": false,
"LookupServiceNameAndLocation": false,
"ValueFilter": {
"Value": "",
"ValueType": "bool"
},
"IsValueFilterEnabled": false
},
"Ui": {
"x": 104,
"y": 237,
"nodeType": ""
},
"TypeAlias": "Trigger",
"LastValue": false
},
{
"Id": "7",
"Type": "rest_action",
"Label": "Send to Pushover notification",
"Address": "",
"Service": "",
"ServiceInterface": "",
"SuccessTransition": "",
"ErrorTransition": "",
"Config": {
"Url": "https://api.pushover.net/1/messages.json",
"Method": "POST",
"RequestPayloadType": "json",
"RequestTemplate": "{\n\"token\":\"INSERT TOKEN HERE\",\n\"user\":\"INSERT USER TOKEN HERE\",\n\"title\":\"Title\",\n\"message\":\"message\"\n}",
"LogResponse": true,
"Headers": [
{
"Name": "Content-type",
"Value": "application/json"
}
],
"ResponseMapping": [],
"Auth": {
"Enabled": false,
"GrantType": "password",
"Url": "http://",
"ClientID": "",
"ClientSecret": "",
"Scope": "",
"Username": "",
"Password": ""
}
},
"Ui": {
"x": 84,
"y": 606,
"nodeType": ""
},
"TypeAlias": "HTTP msg"
},
{
"Id": "8",
"Type": "if",
"Label": "if ON",
"Address": "",
"Service": "",
"ServiceInterface": "",
"SuccessTransition": "",
"ErrorTransition": "",
"Config": {
"TrueTransition": "7",
"FalseTransition": "9",
"Expression": [
{
"Operand": "eq",
"LeftVariableName": "",
"LeftVariableIsGlobal": false,
"RightVariable": {
"Value": true,
"ValueType": "bool"
},
"BooleanOperator": ""
}
]
},
"Ui": {
"x": 92,
"y": 428,
"nodeType": ""
},
"TypeAlias": "If condition"
},
{
"Id": "9",
"Type": "rest_action",
"Label": "Send to Pushover glance",
"Address": "",
"Service": "",
"ServiceInterface": "",
"SuccessTransition": "",
"ErrorTransition": "",
"Config": {
"Url": "https://api.pushover.net/1/glances.json",
"Method": "POST",
"RequestPayloadType": "json",
"RequestTemplate": "{\n\"token\":\"INSERT TOKEN HERE\",\n\"user\":\"INSERT USER TOKEN HERE\",\n\"title\":\"Title\",\n\"text\":\"text on line 1\",\n\"subtext\":\"text on line 2\"\n}",
"LogResponse": true,
"Headers": [
{
"Name": "Content-type",
"Value": "application/json"
}
],
"ResponseMapping": [],
"Auth": {
"Enabled": false,
"GrantType": "password",
"Url": "http://",
"ClientID": "",
"ClientSecret": "",
"Scope": "",
"Username": "",
"Password": ""
}
},
"Ui": {
"x": 363,
"y": 609,
"nodeType": ""
},
"TypeAlias": "HTTP msg"
}
],
"Settings": null,
"IsDisabled": false,
"IsDefault": false,
"ParallelExecution": "parallel"
}
Screenshots:
Notification:
Teksten er satt til "title"
& "message"
så en kan se hvilken tekst som vises hvor
Glance:
Apple Watch
Pushing data to the Apple Watch must be done infrequently, or WatchOS will stop processing updates due to battery concerns. Please note that Pushover does not do any throttling of your data updates, so it is up to you to throttle your Glances API calls. When sending data to the Apple Watch, we recommend at least 20 minutes between each call. If you have pushed too much data and WatchOS stops processing updates, this resets overnight.
Hvordan jeg har brukt det i testen er via NodeRED
Link in
noden er den samme som jeg bruker for Google Home (har lagt til en link out
fra MQTT noden). ref:
Det er node-red-contrib-pushover
paletten som brukes.
Vil da bli seende ut som dette