Repository navigation
Expand file tree
/
Copy pathpushover.html
More file actions
229 lines (213 loc) · 9.12 KB
/
Copy pathpushover.html
File metadata and controls
229 lines (213 loc) · 9.12 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
<script type="text/x-red" data-template-name="ntc-node-red-pushover-keys">
<div className="form-row">
<label htmlFor="node-config-input-userKey"><i className="icon-bookmark"></i> User</label>
<input type="text" id="node-config-input-userKey" placeholder="Pushover User Key">
</div>
<div className="form-row">
<label htmlFor="node-config-input-token"><i className="icon-bookmark"></i> Token</label>
<input type="text" id="node-config-input-token" placeholder="Pushover Token">
</div>
<br/>
<div className="form-row">
<label htmlFor="node-config-input-name"><i className="fa fa-tag"></i> Name</label>
<input type="text" id="node-config-input-name" placeholder="Pushover Credentials">
</div>
</script>
<script type="text/javascript">
RED.nodes.registerType('ntc-node-red-pushover-keys', {
category: 'config',
defaults: {
name: {value: ""},
},
credentials: {
userKey: {type: "text", required: true},
token: {type: "text", required: true}
},
label: function () {
return this.name || "Pushover Credentials";
},
paletteLabel: "Pushover Credentials"
});
</script>
<script type="text/x-red" data-template-name="ntc-node-red-pushover-notifications">
<div className="form-row">
<label htmlFor="node-input-title"><i className="fa fa-bell"></i> Title</label>
<input type="text" id="node-input-title" placeholder="Node-RED Notification">
</div>
<div className="form-row">
<label htmlFor="node-input-keys"><i className="fa fa-user"></i> Keys</label>
<input type="text" id="node-input-keys" placeholder="Pushover Credentials">
</div>
<br/>
<div className="form-row">
<label htmlFor="node-input-name"><i className="fa fa-tag"></i> Name</label>
<input type="text" id="node-input-name" placeholder="Name">
</div>
<div className="form-tips" id="node-tip">
A <code>msg.payload</code> is required to send as the message of the notification.<br>
See help for more available options.
</div>
</script>
<script type="text/x-red" data-help-name="ntc-node-red-pushover-notifications">
<img src='icons/help-pushover-logo.png'/>
<p>Uses Pushover to push a notification to a device that has the Pushover app installed.</p>
<p>Supports rich text notifications with an image attachment.</p>
<h3>Required Inputs</h3>
<dl className="message-properties">
<dt>msg.payload</dt>
<dd>The message of the notification, supports a few <a href="https://pushover.net/api#html">html tags</a></dd>
</dl>
<h3>Optional Inputs</h3>
<dl className="message-properties">
<dt>msg.topic</dt>
<dd>This will be used as the title of the notification if <b>Title</b> is not set</dd>
<dt>msg.image</dt>
<dd>The URL of the image in the notification, supports a local file path or http(s) url</dd>
<dt>msg.url</dt>
<dd>Can add an url to your notification</dd>
<dt>msg.url_title</dt>
<dd>Can set the title of the url</dd>
<dt>msg.priority</dt>
<dd>-2/-1/1/2. Default: 0 (normal)<br>If the priority is 2 (emergency), you should provide <code>msg.retry</code> and <code>msg.expire</code>. <br><a href="https://pushover.net/api#priority">see explains</a></dd>
<dt>msg.device</dt>
<dd>Default for all devices if not provided. Separated by a comma</dd>
<dt>msg.sound</dt>
<dd>Name of the notification sound, <a href="https://pushover.net/api#sounds">see the list</a></dd>
<dt>msg.timestamp</dt>
<dd>An unix timestamp to specific the date time of your notification</dd>
</dl>
</script>
<script type="text/javascript">
RED.nodes.registerType('ntc-node-red-pushover-notifications', {
category: 'Pushover',
defaults: {
keys: {type: "ntc-node-red-pushover-keys", required: true},
title: {value: ""},
name: {value: ""}
},
color: "#209BF0",
inputs: 1,
outputs: 1,
icon: "pushover.svg",
align: "right",
label: function () {
return this.name || "Notifications";
},
paletteLabel: "Notifications"
});
</script>
<script type="text/x-red" data-template-name="ntc-node-red-pushover-glances">
<div className="form-row">
<label htmlFor="node-input-keys"><i className="fa fa-user"></i> Keys</label>
<input type="text" id="node-input-keys" placeholder="Pushover Credentials">
</div>
<br/>
<div className="form-row">
<label htmlFor="node-input-title"><i className="fa fa-align-left"></i> Title</label>
<input type="text" id="node-input-title" placeholder="Leave blank to use msg.topic">
</div>
<div className="form-row">
<label htmlFor="node-input-text"><i className="fa fa-align-left"></i> Text</label>
<input type="text" id="node-input-text" placeholder="Leave blank to use msg.payload">
</div>
<div className="form-row">
<label htmlFor="node-input-subtext"><i className="fa fa-align-left"></i> Subtext</label>
<input type="text" id="node-input-subtext" placeholder="Leave blank to use msg.subtext">
</div>
<br/>
<div className="form-row">
<label htmlFor="node-input-name"><i className="fa fa-tag"></i> Name</label>
<input type="text" id="node-input-name" placeholder="Name">
</div>
<div className="form-tips" id="node-tip">
See help for more available inputs.
</div>
</script>
<script type="text/x-red" data-help-name="ntc-node-red-pushover-glances">
<img src='icons/help-pushover-glances-preview.jpg'/>
<p>With Pushover's Glances API, you can push small bits of data directly to a constantly-updated screen, referred to as a widget, such as an application on your smart watch or a widget on your phone's lock screen. </p>
<h3>Available Inputs</h3>
<dl className="message-properties">
<img src='icons/help-pushover-glances-props.png'/>
<dt>msg.topic<span className="property-type">string (100 characters)</span></dt>
<dd>This will be used as the title if <b>Title</b> is not set</dd>
<dt>msg.payload<span className="property-type">string (100 characters)</span></dt>
<dd>The main line</dd>
<dt>msg.subtext<span className="property-type">string (100 characters)</span></dt>
<dd>The second line</dd>
<dt>msg.count<span className="property-type">integer (may be negative)</span></dt>
<dd>The number</dd>
<dt>msg.percent<span className="property-type">integer (0 to 100)</span></dt>
<dd>The progress bar/circle</dd>
<dt>msg.device<span className="property-type">string</span></dt>
<dd>Device name, default for all</dd>
</dl>
</script>
<script type="text/javascript">
RED.nodes.registerType('ntc-node-red-pushover-glances', {
category: 'Pushover',
defaults: {
keys: {type: "ntc-node-red-pushover-keys", required: true},
title: {value: ""},
text: {value: ""},
subtext: {value: ""},
name: {value: ""}
},
color: "#209BF0",
inputs: 1,
outputs: 0,
icon: "pushover-glances.svg",
align: "right",
label: function () {
return this.name || "Glances";
},
paletteLabel: "Glances"
});
</script>
<script type="text/x-red" data-template-name="ntc-node-red-pushover-receipt-cancel">
<div className="form-row">
<label htmlFor="node-input-keys"><i className="fa fa-user"></i> Keys</label>
<input type="text" id="node-input-keys" placeholder="Pushover Credentials">
</div>
<br/>
<div className="form-row">
<label htmlFor="node-input-text"><i className="fa fa-align-left"></i> Receipt Id</label>
<input type="text" id="node-input-text" placeholder="Leave blank to use msg.payload">
</div>
<div className="form-tips" id="node-tip">
A <code>msg.payload</code> is required to send as the Receipt Id to cancel.
</div>
</script>
<script type="text/x-red" data-help-name="ntc-node-red-pushover-receipt-cancel">
<img src='icons/help-pushover-logo.png'/>
<p>
An emergency-priority notification will continue to be sent to devices until it reaches its original expire value.
</p>
<p>
To cancel an emergency-priority notification early, you can use this node.
</p>
<h3>Required Inputs</h3>
<dl className="message-properties">
<dt>msg.payload</dt>
<dd>The Receipt Id to cancel</dd>
</dl>
</script>
<script type="text/javascript">
RED.nodes.registerType('ntc-node-red-pushover-receipt-cancel', {
category: 'Pushover',
defaults: {
keys: {type: "ntc-node-red-pushover-keys", required: true},
title: {value: ""},
name: {value: ""}
},
color: "#209BF0",
inputs: 1,
outputs: 1,
icon: "pushover.svg",
align: "right",
label: function () {
return this.name || "Cancel Receipt";
},
paletteLabel: "Cancel"
});
</script>