node-red-contrib-eskomsepush 0.0.5 → 0.0.7
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/README.md
CHANGED
|
@@ -16,7 +16,7 @@ Internally the node checks every minute if a schedule is currently active or not
|
|
|
16
16
|
|
|
17
17
|
The node has been made to work well together with the [@victronenergy/node-red-contrib-victron](https://flows.nodered.org/node/@victronenergy/node-red-contrib-victron) nodes. One of the main ones being the
|
|
18
18
|
ESS control node for setting the MinSoc, based on the currently active stage. You can find the
|
|
19
|
-
example flow for this via importing the [victron-minsoc-stage-based.json](examples/victron-minsoc-stage-based.json)
|
|
19
|
+
example flow for this via importing the [victron-minsoc-stage-based.json](examples/victron-minsoc-stage-based.json) file.
|
|
20
20
|
|
|
21
21
|
### Configuration
|
|
22
22
|
|
package/package.json
CHANGED
package/src/nodes/eskomsepush.js
CHANGED
|
@@ -105,6 +105,10 @@ module.exports = function (RED) {
|
|
|
105
105
|
start: Date.parse(Schedule.schedule.days[0].date + ' ' + schedule.split('-')[0]),
|
|
106
106
|
end: Date.parse(Schedule.schedule.days[0].date + ' ' + schedule.split('-')[1])
|
|
107
107
|
}
|
|
108
|
+
LoadShedding.schedule.next = {
|
|
109
|
+
start : LoadShedding.schedule.start,
|
|
110
|
+
end : LoadShedding.schedule.end
|
|
111
|
+
}
|
|
108
112
|
}
|
|
109
113
|
if (nowtime < schedule.split('-')[0]) {
|
|
110
114
|
LoadShedding.schedule.next = {
|
|
@@ -113,7 +117,7 @@ module.exports = function (RED) {
|
|
|
113
117
|
}
|
|
114
118
|
}
|
|
115
119
|
}
|
|
116
|
-
if (Object.keys(LoadShedding.schedule.next).length === 0) {
|
|
120
|
+
if (!LoadShedding.schedule.active && Object.keys(LoadShedding.schedule.next).length === 0) {
|
|
117
121
|
const s = Schedule.schedule.days[1].stages[stage - 1][0]
|
|
118
122
|
LoadShedding.schedule.next = {
|
|
119
123
|
start: Date.parse(Schedule.schedule.days[1].date + ' ' + s.split('-')[0]),
|
|
@@ -146,7 +150,7 @@ module.exports = function (RED) {
|
|
|
146
150
|
statusText += 'Stage '+stage
|
|
147
151
|
LoadShedding.active = (LoadShedding.schedule.active || LoadShedding.event.active)
|
|
148
152
|
if (LoadShedding.active) {
|
|
149
|
-
statusText += ' - ' + new Date(LoadShedding.end).toLocaleTimeString()
|
|
153
|
+
statusText += ' - ' + new Date(LoadShedding.next.end).toLocaleTimeString()
|
|
150
154
|
fill = 'red'
|
|
151
155
|
} else {
|
|
152
156
|
statusText += ' - ' + new Date(LoadShedding.next.start).toLocaleTimeString()
|
|
Binary file
|