smart-nodes 0.6.4 → 0.6.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -2,228 +2,225 @@
2
2
 
3
3
  ## Version 0.3.28:
4
4
 
5
- - Added this changlog file.
6
- - Separate values for shutter_complex node for up and down times.
7
- (Open each node and save it, to use the new times. This should be done before the version 0.4.0 is released.)
8
- - For the following nodes you can choose to have one or two outputs (Could be a **breaking change**, please check your nodes).
9
-
10
- - Logic
11
- - Compare
12
- - Hysteresis
13
-
14
- - You can now separately declare the messages that should be sent by the following nodes (Could be a **breaking change**, please check your nodes).
15
-
16
- - Logic
17
- - Compare
18
- - Hysteresis
19
-
20
- - You can choose for the following nodes if they should send the result all the time or only if the result changed.
21
- - Logic
22
- - Compare
23
- - Hysteresis
5
+ - Added this changlog file.
6
+ - Separate values for shutter_complex node for up and down times.
7
+ (Open each node and save it, to use the new times. This should be done before the version 0.4.0 is released.)
8
+ - For the following nodes you can choose to have one or two outputs (Could be a **breaking change**, please check your nodes).
9
+ - Logic
10
+ - Compare
11
+ - Hysteresis
12
+
13
+ - You can now separately declare the messages that should be sent by the following nodes (Could be a **breaking change**, please check your nodes).
14
+ - Logic
15
+ - Compare
16
+ - Hysteresis
17
+
18
+ - You can choose for the following nodes if they should send the result all the time or only if the result changed.
19
+ - Logic
20
+ - Compare
21
+ - Hysteresis
24
22
 
25
23
  ## Version 0.3.29:
26
24
 
27
- - Fixed that hysteresis sends only on change, when separate outputs are enabled.
28
- - Added a definable short up/down time for the shutter control.
29
- - Fixed calculation of the time from string.
25
+ - Fixed that hysteresis sends only on change, when separate outputs are enabled.
26
+ - Added a definable short up/down time for the shutter control.
27
+ - Fixed calculation of the time from string.
30
28
 
31
29
  ## Version 0.3.30:
32
30
 
33
- - Added counter example.
31
+ - Added counter example.
34
32
 
35
33
  ## Version 0.3.31:
36
34
 
37
- - Fixed logic node - invert output option.
35
+ - Fixed logic node - invert output option.
38
36
 
39
37
  ## Version 0.3.32:
40
38
 
41
- - Fixed hysteresis node - always change result.
39
+ - Fixed hysteresis node - always change result.
42
40
 
43
41
  ## Version 0.3.33:
44
42
 
45
- - Fixed hysteresis node - init send.
43
+ - Fixed hysteresis node - init send.
46
44
 
47
45
  ## Version 0.3.34:
48
46
 
49
- - Fixed hysteresis node - init send.
50
- - Fixed light node - status.
47
+ - Fixed hysteresis node - init send.
48
+ - Fixed light node - status.
51
49
 
52
50
  ## Version 0.3.35:
53
51
 
54
- - Fixed saving last message object as a clone of the original message, because it could be changed later.
52
+ - Fixed saving last message object as a clone of the original message, because it could be changed later.
55
53
 
56
54
  ## Version 0.3.36:
57
55
 
58
- - Fixed mixing-valve - call of toFixed function.
56
+ - Fixed mixing-valve - call of toFixed function.
59
57
 
60
58
  ## Version 0.3.37:
61
59
 
62
- - Fixed using typedInput with node-red v4.
63
- - Started to add English translations.
60
+ - Fixed using typedInput with node-red v4.
61
+ - Started to add English translations.
64
62
 
65
63
  ## Version 0.4.0:
66
64
 
67
- - Fully added English and German translations.
68
- - Light control: Added Alarm off action
69
- - Shutter complex control: Added Alarm off action
70
- - Restructured the complete code
71
- - Improved status texts
72
- - **breaking change** (soon): Changed some node internal values. Please open and save the following node types:
73
-
74
- - Central node
75
- - Compare node
76
- - Counter node
77
- - Hysteresis node
78
- - Shutter complex node
79
- - Statistic node
65
+ - Fully added English and German translations.
66
+ - Light control: Added Alarm off action
67
+ - Shutter complex control: Added Alarm off action
68
+ - Restructured the complete code
69
+ - Improved status texts
70
+ - **breaking change** (soon): Changed some node internal values. Please open and save the following node types:
71
+ - Central node
72
+ - Compare node
73
+ - Counter node
74
+ - Hysteresis node
75
+ - Shutter complex node
76
+ - Statistic node
80
77
 
81
78
  After saving the nodes, the values are automatically converted to the new one.
82
79
  This conversion will be removed in version 0.5.0.
83
80
 
84
81
  ## Version 0.4.1:
85
82
 
86
- - Show only up to 2 decimal places in node status text.
87
- - Improved warn messages shown in console.
83
+ - Show only up to 2 decimal places in node status text.
84
+ - Improved warn messages shown in console.
88
85
 
89
86
  ## Version 0.4.2:
90
87
 
91
- - Fixed design of property page of forwarder node.
92
- - Corrected hysteresis to send original message.
88
+ - Fixed design of property page of forwarder node.
89
+ - Corrected hysteresis to send original message.
93
90
 
94
91
  ## Version 0.4.3:
95
92
 
96
- - Corrected hysteresis (again) to send original message.
93
+ - Corrected hysteresis (again) to send original message.
97
94
 
98
95
  ## Version 0.4.4:
99
96
 
100
- - Fixed the delay node to not restart the time if "only on change" option is enabled.
97
+ - Fixed the delay node to not restart the time if "only on change" option is enabled.
101
98
 
102
99
  ## Version 0.4.5:
103
100
 
104
- - Fixed the status of hysteresis node.
101
+ - Fixed the status of hysteresis node.
105
102
 
106
103
  ## Version 0.4.6:
107
104
 
108
- - Fixed the status of hysteresis node.
105
+ - Fixed the status of hysteresis node.
109
106
 
110
107
  ## Version 0.4.7:
111
108
 
112
- - Added blink topic to light node.
109
+ - Added blink topic to light node.
113
110
 
114
111
  ## Version 0.4.8:
115
112
 
116
- - Fixed reading values in heating-curve node.
113
+ - Fixed reading values in heating-curve node.
117
114
 
118
115
  ## Version 0.4.9:
119
116
 
120
- - Fixed reading config values for offset and slope in heating-curve node.
117
+ - Fixed reading config values for offset and slope in heating-curve node.
121
118
 
122
119
  ## Version 0.4.10:
123
120
 
124
- - **breaking change** (soon): Added common and separate outputs to multi press node.
125
- Please open node config and save it to make sure it will work in later versions.
126
- - Added common and separate outputs to long press node.
121
+ - **breaking change** (soon): Added common and separate outputs to multi press node.
122
+ Please open node config and save it to make sure it will work in later versions.
123
+ - Added common and separate outputs to long press node.
127
124
 
128
125
  ## Version 0.4.11:
129
126
 
130
- - Fixed long press default outputs.
127
+ - Fixed long press default outputs.
131
128
 
132
129
  ## Version 0.4.12:
133
130
 
134
- - Fixed text exec node.
131
+ - Fixed text exec node.
135
132
 
136
133
  ## Version 0.4.13:
137
134
 
138
- - Fixed text exec node again.
135
+ - Fixed text exec node again.
139
136
 
140
137
  ## Version 0.4.14:
141
138
 
142
- - Removed log outputs.
139
+ - Removed log outputs.
143
140
 
144
141
  ## Version 0.4.15:
145
142
 
146
- - Reverted some tests.
143
+ - Reverted some tests.
147
144
 
148
145
  ## Version 0.4.16:
149
146
 
150
- - Reverted some tests.
147
+ - Reverted some tests.
151
148
 
152
149
  ## Version 0.4.17:
153
150
 
154
- - Fixed mixing-valve position calculation.
155
- - Fixed up_down message for central node.
151
+ - Fixed mixing-valve position calculation.
152
+ - Fixed up_down message for central node.
156
153
 
157
154
  ## Version 0.4.18:
158
155
 
159
- - Fixed up_down message for central node.
156
+ - Fixed up_down message for central node.
160
157
 
161
158
  ## Version 0.4.19:
162
159
 
163
- - Added min_change_time option to mixing-valve node.
160
+ - Added min_change_time option to mixing-valve node.
164
161
 
165
162
  ## Version 0.4.20:
166
163
 
167
- - Small bugfix.
164
+ - Small bugfix.
168
165
 
169
166
  ## Version 0.4.21:
170
167
 
171
- - Fixed up_down direction in central node..
168
+ - Fixed up_down direction in central node..
172
169
 
173
170
  ## Version 0.4.22:
174
171
 
175
- - Added set_state_inverted topic to forwarder node.
172
+ - Added set_state_inverted topic to forwarder node.
176
173
 
177
174
  ## Version 0.4.23:
178
175
 
179
- - Added set_state_inverted topic to mixing-valve node.
180
- - Added set_state_inverted topic to scheduler node.
181
- - Changed default of save_state and resend_on_start to false for all nodes.
182
- - Hysteresis node can now be defined by min/max values.
183
- - Added support for percentage output for the light node.
176
+ - Added set_state_inverted topic to mixing-valve node.
177
+ - Added set_state_inverted topic to scheduler node.
178
+ - Changed default of save_state and resend_on_start to false for all nodes.
179
+ - Hysteresis node can now be defined by min/max values.
180
+ - Added support for percentage output for the light node.
184
181
 
185
182
  ## Version 0.4.24:
186
183
 
187
- - Added set_inverted to light node.
184
+ - Added set_inverted to light node.
188
185
 
189
186
  ## Version 0.4.25:
190
187
 
191
- - Changed some texts.
188
+ - Changed some texts.
192
189
 
193
190
  ## Version 0.4.26:
194
191
 
195
- - Added possibility to control mixing-valve nodes from central node.
192
+ - Added possibility to control mixing-valve nodes from central node.
196
193
 
197
194
  ## Version 0.4.27:
198
195
 
199
- - Fixed central node.
196
+ - Fixed central node.
200
197
 
201
198
  ## Version 0.4.28:
202
199
 
203
- - Added on and off topic to mixing-valve.
200
+ - Added on and off topic to mixing-valve.
204
201
 
205
202
  ## Version 0.5.0:
206
203
 
207
- - Improved light control percentage status text.
208
- - Fixed logic node when common outputs is configured but one value is set to "send nothing".
209
- - mixing-valve can now output as percentage directly or with open/close impulses.
210
- - mixing-valve tries to guess the best position, when getting enabled.
211
- - Added debug topic to all nodes, to see current values.
212
- - Added new node "mode-selector".
204
+ - Improved light control percentage status text.
205
+ - Fixed logic node when common outputs is configured but one value is set to "send nothing".
206
+ - mixing-valve can now output as percentage directly or with open/close impulses.
207
+ - mixing-valve tries to guess the best position, when getting enabled.
208
+ - Added debug topic to all nodes, to see current values.
209
+ - Added new node "mode-selector".
213
210
 
214
211
  ## Version 0.5.1:
215
212
 
216
- - To be more compatible, topic "set" is also possible instead of "set_state". Same for "set_inverted" instead of "set_state_inverted".
213
+ - To be more compatible, topic "set" is also possible instead of "set_state". Same for "set_inverted" instead of "set_state_inverted".
217
214
 
218
215
  ## Version 0.5.2:
219
216
 
220
- - Added alarm mode to mixing-valve.
217
+ - Added alarm mode to mixing-valve.
221
218
 
222
219
  ## Version 0.6.0:
223
220
 
224
- - Reduced amount of messages sent by light node when it is in alarm mode.
225
- - Fixed forwarder node causing an error when no topic was sent.
226
- - Added Jest example for all nodes to be able to debug nodes in vscode.
221
+ - Reduced amount of messages sent by light node when it is in alarm mode.
222
+ - Fixed forwarder node causing an error when no topic was sent.
223
+ - Added Jest example for all nodes to be able to debug nodes in vscode.
227
224
 
228
225
  ## Version 0.6.1:
229
226
 
@@ -240,4 +237,13 @@
240
237
 
241
238
  ## Version 0.6.4:
242
239
 
243
- - Do off mode for the full time, in case the real position dismatch the known position in the node.
240
+ - Do off mode for the full time, in case the real position dismatch the known position in the node.
241
+
242
+ ## Version 0.6.5:
243
+
244
+ - Fixed light alarm mode, when status changed to an invalid.
245
+
246
+ ## Version 0.6.6:
247
+
248
+ - Counter can be configured in 0.1 steps. For smaller steps, use msg.payload value.
249
+ - Counter has a new topic refresh, to resend the last saved value.
@@ -1 +1 @@
1
- {"idn1":{"enabled":false,"setpoint":20,"current_temperature":null,"last_position":50,"last_enabled_sended":null,"alarm_active":false,"value":null,"last_message":null}}
1
+ {"idn1":{"last_value":false,"last_value_before_alarm":false,"last_value_sended":false,"alarm_active":false}}6666666666667,"alarm_active":false}}
@@ -29,6 +29,7 @@
29
29
  $("#node-input-start")
30
30
  .css("max-width", "4rem")
31
31
  .spinner({
32
+ step: 0.1,
32
33
  change: function (event, ui)
33
34
  {
34
35
  var value = parseFloat(this.value);
@@ -40,6 +41,7 @@
40
41
  $("#node-input-step")
41
42
  .css("max-width", "4rem")
42
43
  .spinner({
44
+ step: 0.1,
43
45
  change: function (event, ui)
44
46
  {
45
47
  var value = parseFloat(this.value);
@@ -51,6 +53,7 @@
51
53
  $("#node-input-min")
52
54
  .css("max-width", "4rem")
53
55
  .spinner({
56
+ step: 0.1,
54
57
  change: function (event, ui)
55
58
  {
56
59
  var value = parseFloat(this.value);
@@ -62,6 +65,7 @@
62
65
  $("#node-input-max")
63
66
  .css("max-width", "4rem")
64
67
  .spinner({
68
+ step: 0.1,
65
69
  change: function (event, ui)
66
70
  {
67
71
  var value = parseFloat(this.value);
@@ -37,10 +37,10 @@ module.exports = function (RED)
37
37
  // ##################
38
38
  // # Dynamic config #
39
39
  // ##################
40
- let start = parseInt(config.start, 10);
41
- let step = parseInt(config.step, 10);
42
- let min = parseInt(config.min, 10);
43
- let max = parseInt(config.max, 10);
40
+ let start = parseFloat(config.start);
41
+ let step = parseFloat(config.step);
42
+ let min = parseFloat(config.min);
43
+ let max = parseFloat(config.max);
44
44
  let out_message = helper.evaluateNodeProperty(RED, config.out_message, config.out_message_type);
45
45
 
46
46
 
@@ -53,9 +53,8 @@ module.exports = function (RED)
53
53
  {
54
54
  handleTopic(msg);
55
55
 
56
- sendResult();
57
-
58
56
  setStatus();
57
+
59
58
  smart_context.set(node.id, node_settings);
60
59
  });
61
60
 
@@ -121,7 +120,11 @@ module.exports = function (RED)
121
120
 
122
121
  node_settings.value = temp_value;
123
122
  break;
124
-
123
+
124
+ case "refresh":
125
+ // Nothing to do, just resend the last message if value is set
126
+ break;
127
+
125
128
  default:
126
129
  node.error("Invalid topic: " + real_topic);
127
130
  return;
@@ -129,15 +132,9 @@ module.exports = function (RED)
129
132
 
130
133
  // Check value is in range
131
134
  node_settings.value = Math.min(max, Math.max(min, node_settings.value));
132
- }
133
-
134
- /**
135
- * Send the result to the output
136
- */
137
- let sendResult = () =>
138
- {
135
+
139
136
  // Nothing changed, nothing to do
140
- if (node_settings.value == node_settings.last_message?.payload)
137
+ if (real_topic != "refresh" && node_settings.value == node_settings.last_message?.payload)
141
138
  return;
142
139
 
143
140
  // if out_message is set, use this instead of the default message
package/light/light.js CHANGED
@@ -363,7 +363,7 @@ module.exports = function (RED)
363
363
  }
364
364
  }
365
365
 
366
- if (real_topic != "status" && current_output_state !== node_settings.last_value)
366
+ if ((node_settings.alarm_active || real_topic != "status") && current_output_state !== node_settings.last_value)
367
367
  {
368
368
  node.send({ payload: node_settings.last_value });
369
369
  current_output_state = node_settings.last_value;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "smart-nodes",
3
- "version": "0.6.4",
3
+ "version": "0.6.6",
4
4
  "description": "Controls light, shutters and more. Includes common used logic and statistic nodes to control your home.",
5
5
  "keywords": [
6
6
  "node-red",
@@ -192,6 +192,18 @@ module.exports = function (RED)
192
192
  case "position":
193
193
  startAction(ACTION_POSITION, msg.payload ?? null);
194
194
  break;
195
+
196
+ case "status_up":
197
+ // TODO: if status changed from false to true, start time measurement to calculate position
198
+ // if status changed from true to false, stop time measurement and save position
199
+ // if alarm is active, check if current action is allowed and stop if not
200
+ break;
201
+
202
+ case "status_down":
203
+ // TODO: if status changed from false to true, start time measurement to calculate position
204
+ // if status changed from true to false, stop time measurement and save position
205
+ // if alarm is active, check if current action is allowed and stop if not
206
+ break;
195
207
 
196
208
  case "alarm":
197
209
  // Make sure it is bool
@@ -263,6 +275,7 @@ module.exports = function (RED)
263
275
  */
264
276
  let startAction = (action, data = null, exact = false, ignoreAlarm = false) =>
265
277
  {
278
+ // TODO: Remove time measurment and use status messages to calculate position and direction.
266
279
  helper.log(node, "startAction", { action, data, exact, ignoreAlarm });
267
280
 
268
281
  // Nothing allowed if alarm is on