node-red-contrib-power-saver 3.4.0 → 3.4.1
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/.firebase/hosting.ZG9jcy8udnVlcHJlc3MvZGlzdA.cache +221 -0
- package/.firebaserc +5 -0
- package/.github/workflows/firebase-hosting-merge.yml +20 -0
- package/.github/workflows/firebase-hosting-pull-request.yml +17 -0
- package/README.md +1 -1
- package/docs/.vuepress/components/BestSaveVerificator.vue +3 -3
- package/docs/.vuepress/config.js +8 -0
- package/docs/.vuepress/dist/404.html +23 -5
- package/docs/.vuepress/dist/assets/css/896.styles.21a80cb6.css +1 -0
- package/docs/.vuepress/dist/assets/css/styles.1c48cbd0.css +10 -0
- package/docs/.vuepress/dist/assets/js/229.5c5378fa.js +1 -0
- package/docs/.vuepress/dist/assets/js/331.872104cd.js +1 -0
- package/docs/.vuepress/dist/assets/js/405.f4edd94d.js +2 -0
- package/docs/.vuepress/dist/assets/js/{619.8ba1b1f6.js.LICENSE.txt → 405.f4edd94d.js.LICENSE.txt} +0 -0
- package/docs/.vuepress/dist/assets/js/490.1e639e05.js +1 -0
- package/docs/.vuepress/dist/assets/js/{491.17a98f38.js → 491.bd938119.js} +1 -1
- package/docs/.vuepress/dist/assets/js/555.d8963d84.js +1 -0
- package/docs/.vuepress/dist/assets/js/{811.6a3392d5.js → 811.5f659592.js} +0 -0
- package/docs/.vuepress/dist/assets/js/app.999deae8.js +1 -0
- package/docs/.vuepress/dist/assets/js/runtime~app.1774b667.js +1 -0
- package/docs/.vuepress/dist/assets/js/v-0607240a.1304cbb6.js +1 -0
- package/docs/.vuepress/dist/assets/js/v-08683c60.52e94cb6.js +1 -0
- package/docs/.vuepress/dist/assets/js/{v-0aca7ba6.4f3573a3.js → v-0aca7ba6.cac5d4b9.js} +1 -1
- package/docs/.vuepress/dist/assets/js/v-0b5e3c8c.18561f6e.js +1 -0
- package/docs/.vuepress/dist/assets/js/v-1ad821fa.6697a349.js +1 -0
- package/docs/.vuepress/dist/assets/js/v-1b3a0ab8.c6c4e19b.js +1 -0
- package/docs/.vuepress/dist/assets/js/v-1e2b191e.07b8ab21.js +1 -0
- package/docs/.vuepress/dist/assets/js/v-29504124.00be7399.js +1 -0
- package/docs/.vuepress/dist/assets/js/v-30acb564.28af12af.js +1 -0
- package/docs/.vuepress/dist/assets/js/{v-3706649a.d7f73384.js → v-3706649a.c76d575b.js} +1 -1
- package/docs/.vuepress/dist/assets/js/v-4637f9e4.d334c29a.js +1 -0
- package/docs/.vuepress/dist/assets/js/v-4c28314d.8cbb0f9d.js +1 -0
- package/docs/.vuepress/dist/assets/js/v-510ed0d4.14f08cf3.js +1 -0
- package/docs/.vuepress/dist/assets/js/{v-5954bcb2.937005d0.js → v-5954bcb2.dff3fc67.js} +1 -1
- package/docs/.vuepress/dist/assets/js/v-5db8da3a.e5e6d7a6.js +1 -0
- package/docs/.vuepress/dist/assets/js/v-61f728ca.81968036.js +1 -0
- package/docs/.vuepress/dist/assets/js/v-677dfaed.c159b0f4.js +1 -0
- package/docs/.vuepress/dist/assets/js/v-7446a652.88afb5e4.js +1 -0
- package/docs/.vuepress/dist/assets/js/{v-7c87f26e.5e3553b0.js → v-7c87f26e.8ed52391.js} +1 -1
- package/docs/.vuepress/dist/assets/js/v-84304104.ad4da2d5.js +1 -0
- package/docs/.vuepress/dist/assets/js/{v-8daa1a0e.c06c5c76.js → v-8daa1a0e.ed84ca09.js} +1 -1
- package/docs/.vuepress/dist/assets/js/{v-b4a42144.733e4e7c.js → v-b4a42144.9a2a0c9f.js} +1 -1
- package/docs/.vuepress/dist/assets/js/v-e8c55052.b7d52fc6.js +1 -0
- package/docs/.vuepress/dist/assets/js/v-fffb8e28.d09ab959.js +1 -0
- package/docs/.vuepress/dist/changelog/index.html +23 -5
- package/docs/.vuepress/dist/contribute/index.html +23 -5
- package/docs/.vuepress/dist/examples/example-cascade-temperature-control.html +24 -6
- package/docs/.vuepress/dist/examples/example-heat-capacitor.html +24 -6
- package/docs/.vuepress/dist/examples/example-next-schedule-entity.html +27 -9
- package/docs/.vuepress/dist/examples/example-nordpool-current-state.html +24 -6
- package/docs/.vuepress/dist/examples/example-nordpool-events-state.html +24 -6
- package/docs/.vuepress/dist/examples/example-tibber-mqtt.html +24 -6
- package/docs/.vuepress/dist/examples/index.html +23 -5
- package/docs/.vuepress/dist/faq/best-save-viewer.html +23 -5
- package/docs/.vuepress/dist/faq/index.html +23 -5
- package/docs/.vuepress/dist/guide/index.html +24 -6
- package/docs/.vuepress/dist/index.html +23 -5
- package/docs/.vuepress/dist/nodes/index.html +23 -5
- package/docs/.vuepress/dist/nodes/old-power-saver-doc.html +25 -7
- package/docs/.vuepress/dist/nodes/power-saver.html +23 -5
- package/docs/.vuepress/dist/nodes/ps-elvia-add-tariff.html +23 -5
- package/docs/.vuepress/dist/nodes/ps-general-add-tariff.html +23 -5
- package/docs/.vuepress/dist/nodes/ps-receive-price.html +26 -8
- package/docs/.vuepress/dist/nodes/ps-strategy-best-save.html +26 -8
- package/docs/.vuepress/dist/nodes/ps-strategy-heat-capacitor.html +24 -6
- package/docs/.vuepress/dist/nodes/ps-strategy-lowest-price.html +24 -6
- package/docs/.vuepress/dist/nodes/strategy-input.html +24 -6
- package/docs/changelog/README.md +6 -0
- package/docs/examples/example-cascade-temperature-control.md +19 -18
- package/examples/add-general-tariff.json +103 -0
- package/examples/best-save-for-water-heater.json +140 -0
- package/examples/elvia-add-tariff.json +99 -0
- package/examples/elvia-get-tariff-types.json +58 -0
- package/examples/elvia-get-tariff.json +60 -0
- package/examples/heat-capacitor-for-room-heating.json +186 -0
- package/examples/lowest-price-for-heating-cables.json +159 -0
- package/firebase.json +6 -0
- package/package.json +16 -9
- package/public/404.html +33 -0
- package/public/index.html +89 -0
- package/src/elvia/elvia-tariff.js +2 -1
- package/test/strategy-heat-capacitor.test.js +0 -2
- package/test/strategy-lowest-price-functions.test.js +1 -1
- package/test/utils.test.js +0 -2
- package/docs/.vuepress/dist/.nojekyll +0 -0
- package/docs/.vuepress/dist/assets/css/563.styles.99f4a8aa.css +0 -1
- package/docs/.vuepress/dist/assets/css/styles.031dcf27.css +0 -9
- package/docs/.vuepress/dist/assets/js/262.cf2c57d2.js +0 -1
- package/docs/.vuepress/dist/assets/js/293.08ea5200.js +0 -1
- package/docs/.vuepress/dist/assets/js/331.15ee3c51.js +0 -1
- package/docs/.vuepress/dist/assets/js/619.8ba1b1f6.js +0 -2
- package/docs/.vuepress/dist/assets/js/app.e881e9b6.js +0 -1
- package/docs/.vuepress/dist/assets/js/runtime~app.8bebaa00.js +0 -1
- package/docs/.vuepress/dist/assets/js/v-0607240a.a57c2199.js +0 -1
- package/docs/.vuepress/dist/assets/js/v-08683c60.ccafdcab.js +0 -1
- package/docs/.vuepress/dist/assets/js/v-0b5e3c8c.76407435.js +0 -1
- package/docs/.vuepress/dist/assets/js/v-1ad821fa.5978386f.js +0 -1
- package/docs/.vuepress/dist/assets/js/v-1b3a0ab8.def099e9.js +0 -1
- package/docs/.vuepress/dist/assets/js/v-1e2b191e.88dc5555.js +0 -1
- package/docs/.vuepress/dist/assets/js/v-29504124.4aca27d5.js +0 -1
- package/docs/.vuepress/dist/assets/js/v-30acb564.529a3c16.js +0 -1
- package/docs/.vuepress/dist/assets/js/v-4637f9e4.5cc542f6.js +0 -1
- package/docs/.vuepress/dist/assets/js/v-4c28314d.48fc6e75.js +0 -1
- package/docs/.vuepress/dist/assets/js/v-510ed0d4.b58000bf.js +0 -1
- package/docs/.vuepress/dist/assets/js/v-5db8da3a.3de3588d.js +0 -1
- package/docs/.vuepress/dist/assets/js/v-61f728ca.21d432fe.js +0 -1
- package/docs/.vuepress/dist/assets/js/v-677dfaed.1ad4c776.js +0 -1
- package/docs/.vuepress/dist/assets/js/v-7446a652.74b21d0b.js +0 -1
- package/docs/.vuepress/dist/assets/js/v-84304104.f66996c5.js +0 -1
- package/docs/.vuepress/dist/assets/js/v-e8c55052.9664f731.js +0 -1
- package/docs/.vuepress/dist/assets/js/v-fffb8e28.525be02a.js +0 -1
|
@@ -0,0 +1,186 @@
|
|
|
1
|
+
[
|
|
2
|
+
{
|
|
3
|
+
"id": "135c4e7649611314",
|
|
4
|
+
"type": "tab",
|
|
5
|
+
"label": "PowerSaver",
|
|
6
|
+
"disabled": false,
|
|
7
|
+
"info": "",
|
|
8
|
+
"env": []
|
|
9
|
+
},
|
|
10
|
+
{
|
|
11
|
+
"id": "cf5908a52e0aee5e",
|
|
12
|
+
"type": "ps-receive-price",
|
|
13
|
+
"z": "135c4e7649611314",
|
|
14
|
+
"name": "Price Receiver",
|
|
15
|
+
"x": 400,
|
|
16
|
+
"y": 320,
|
|
17
|
+
"wires": [["b7b85590b7d28ba6"]]
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
"id": "b08bc12bf8734c5a",
|
|
21
|
+
"type": "tibber-query",
|
|
22
|
+
"z": "135c4e7649611314",
|
|
23
|
+
"name": "",
|
|
24
|
+
"active": true,
|
|
25
|
+
"apiEndpointRef": "9ea07b03b88cb526",
|
|
26
|
+
"x": 230,
|
|
27
|
+
"y": 320,
|
|
28
|
+
"wires": [["cf5908a52e0aee5e"]]
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
"id": "d0d4dd31efe67e85",
|
|
32
|
+
"type": "inject",
|
|
33
|
+
"z": "135c4e7649611314",
|
|
34
|
+
"name": "",
|
|
35
|
+
"props": [
|
|
36
|
+
{
|
|
37
|
+
"p": "payload"
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
"p": "topic",
|
|
41
|
+
"vt": "str"
|
|
42
|
+
}
|
|
43
|
+
],
|
|
44
|
+
"repeat": "60",
|
|
45
|
+
"crontab": "",
|
|
46
|
+
"once": true,
|
|
47
|
+
"onceDelay": "1",
|
|
48
|
+
"topic": "",
|
|
49
|
+
"payload": "{viewer{homes{currentSubscription{priceInfo{today{totalstartsAt}tomorrow{totalstartsAt}}}}}}",
|
|
50
|
+
"payloadType": "str",
|
|
51
|
+
"x": 90,
|
|
52
|
+
"y": 320,
|
|
53
|
+
"wires": [["b08bc12bf8734c5a"]]
|
|
54
|
+
},
|
|
55
|
+
{
|
|
56
|
+
"id": "4831f393a0066565",
|
|
57
|
+
"type": "api-call-service",
|
|
58
|
+
"z": "135c4e7649611314",
|
|
59
|
+
"name": "Set temperature",
|
|
60
|
+
"server": "e2dd69fb.8f70a8",
|
|
61
|
+
"version": 3,
|
|
62
|
+
"debugenabled": false,
|
|
63
|
+
"service_domain": "climate",
|
|
64
|
+
"service": "set_temperature",
|
|
65
|
+
"entityId": "climate.my_climate",
|
|
66
|
+
"data": "{\"entity_id\":\"climate.my_climate\",\"temperature\":\"{{adj_setpoint}}\"}",
|
|
67
|
+
"dataType": "json",
|
|
68
|
+
"mergecontext": "",
|
|
69
|
+
"mustacheAltTags": false,
|
|
70
|
+
"outputProperties": [],
|
|
71
|
+
"queue": "none",
|
|
72
|
+
"x": 980,
|
|
73
|
+
"y": 320,
|
|
74
|
+
"wires": [[]]
|
|
75
|
+
},
|
|
76
|
+
{
|
|
77
|
+
"id": "027f4267d969e1b8",
|
|
78
|
+
"type": "server-state-changed",
|
|
79
|
+
"z": "135c4e7649611314",
|
|
80
|
+
"name": "Setpoint",
|
|
81
|
+
"server": "e2dd69fb.8f70a8",
|
|
82
|
+
"version": 3,
|
|
83
|
+
"exposeToHomeAssistant": false,
|
|
84
|
+
"haConfig": [
|
|
85
|
+
{
|
|
86
|
+
"property": "name",
|
|
87
|
+
"value": ""
|
|
88
|
+
},
|
|
89
|
+
{
|
|
90
|
+
"property": "icon",
|
|
91
|
+
"value": ""
|
|
92
|
+
}
|
|
93
|
+
],
|
|
94
|
+
"entityidfilter": "input_number.setpoint",
|
|
95
|
+
"entityidfiltertype": "exact",
|
|
96
|
+
"outputinitially": true,
|
|
97
|
+
"state_type": "num",
|
|
98
|
+
"haltifstate": "",
|
|
99
|
+
"halt_if_type": "str",
|
|
100
|
+
"halt_if_compare": "is",
|
|
101
|
+
"outputs": 1,
|
|
102
|
+
"output_only_on_state_change": false,
|
|
103
|
+
"for": 0,
|
|
104
|
+
"forType": "num",
|
|
105
|
+
"forUnits": "minutes",
|
|
106
|
+
"ignorePrevStateNull": false,
|
|
107
|
+
"ignorePrevStateUnknown": false,
|
|
108
|
+
"ignorePrevStateUnavailable": false,
|
|
109
|
+
"ignoreCurrentStateUnknown": true,
|
|
110
|
+
"ignoreCurrentStateUnavailable": true,
|
|
111
|
+
"outputProperties": [
|
|
112
|
+
{
|
|
113
|
+
"property": "payload.config.setpoint",
|
|
114
|
+
"propertyType": "msg",
|
|
115
|
+
"value": "",
|
|
116
|
+
"valueType": "entityState"
|
|
117
|
+
},
|
|
118
|
+
{
|
|
119
|
+
"property": "data",
|
|
120
|
+
"propertyType": "msg",
|
|
121
|
+
"value": "",
|
|
122
|
+
"valueType": "eventData"
|
|
123
|
+
},
|
|
124
|
+
{
|
|
125
|
+
"property": "topic",
|
|
126
|
+
"propertyType": "msg",
|
|
127
|
+
"value": "",
|
|
128
|
+
"valueType": "triggerId"
|
|
129
|
+
}
|
|
130
|
+
],
|
|
131
|
+
"x": 420,
|
|
132
|
+
"y": 360,
|
|
133
|
+
"wires": [["b7b85590b7d28ba6"]]
|
|
134
|
+
},
|
|
135
|
+
{
|
|
136
|
+
"id": "b7b85590b7d28ba6",
|
|
137
|
+
"type": "ps-strategy-heat-capacitor",
|
|
138
|
+
"z": "135c4e7649611314",
|
|
139
|
+
"name": "Heat capacitor",
|
|
140
|
+
"timeHeat1C": "70",
|
|
141
|
+
"timeCool1C": 50,
|
|
142
|
+
"maxTempAdjustment": "1",
|
|
143
|
+
"boostTempHeat": "2",
|
|
144
|
+
"boostTempCool": "2",
|
|
145
|
+
"minSavings": 0.08,
|
|
146
|
+
"setpoint": 23,
|
|
147
|
+
"x": 600,
|
|
148
|
+
"y": 320,
|
|
149
|
+
"wires": [["2b7cbdef3203a482"], [], []]
|
|
150
|
+
},
|
|
151
|
+
{
|
|
152
|
+
"id": "2b7cbdef3203a482",
|
|
153
|
+
"type": "function",
|
|
154
|
+
"z": "135c4e7649611314",
|
|
155
|
+
"name": "Adjust setpoint",
|
|
156
|
+
"func": "//In case the climate entity can only handle integers\n//Calculate rounded setpoint for the climate entity and return the msg\nmsg.adj_setpoint=Math.round(msg.payload);\nreturn msg\n",
|
|
157
|
+
"outputs": 1,
|
|
158
|
+
"noerr": 0,
|
|
159
|
+
"initialize": "",
|
|
160
|
+
"finalize": "",
|
|
161
|
+
"libs": [],
|
|
162
|
+
"x": 800,
|
|
163
|
+
"y": 320,
|
|
164
|
+
"wires": [["4831f393a0066565"]]
|
|
165
|
+
},
|
|
166
|
+
{
|
|
167
|
+
"id": "9ea07b03b88cb526",
|
|
168
|
+
"type": "tibber-api-endpoint",
|
|
169
|
+
"feedUrl": "wss://api.tibber.com/v1-beta/gql/subscriptions",
|
|
170
|
+
"queryUrl": "https://api.tibber.com/v1-beta/gql",
|
|
171
|
+
"name": "Tibber"
|
|
172
|
+
},
|
|
173
|
+
{
|
|
174
|
+
"id": "e2dd69fb.8f70a8",
|
|
175
|
+
"type": "server",
|
|
176
|
+
"name": "Home Assistant",
|
|
177
|
+
"version": 2,
|
|
178
|
+
"addon": false,
|
|
179
|
+
"rejectUnauthorizedCerts": true,
|
|
180
|
+
"ha_boolean": "y|yes|true|on|home|open",
|
|
181
|
+
"connectionDelay": false,
|
|
182
|
+
"cacheJson": true,
|
|
183
|
+
"heartbeat": false,
|
|
184
|
+
"heartbeatInterval": 30
|
|
185
|
+
}
|
|
186
|
+
]
|
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
[
|
|
2
|
+
{
|
|
3
|
+
"id": "4f11b5ae.4cc22c",
|
|
4
|
+
"type": "inject",
|
|
5
|
+
"z": "d938c47f.3398f8",
|
|
6
|
+
"name": "Refresh",
|
|
7
|
+
"props": [
|
|
8
|
+
{
|
|
9
|
+
"p": "payload"
|
|
10
|
+
}
|
|
11
|
+
],
|
|
12
|
+
"repeat": "3600",
|
|
13
|
+
"crontab": "",
|
|
14
|
+
"once": true,
|
|
15
|
+
"onceDelay": "1",
|
|
16
|
+
"topic": "",
|
|
17
|
+
"payload": "{viewer{homes{currentSubscription{priceInfo{today{totalstartsAt}tomorrow{totalstartsAt}}}}}}",
|
|
18
|
+
"payloadType": "str",
|
|
19
|
+
"x": 120,
|
|
20
|
+
"y": 40,
|
|
21
|
+
"wires": [["ab2d599a.077738"]]
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
"id": "ab2d599a.077738",
|
|
25
|
+
"type": "tibber-query",
|
|
26
|
+
"z": "d938c47f.3398f8",
|
|
27
|
+
"name": "Get Tibber prices",
|
|
28
|
+
"active": true,
|
|
29
|
+
"apiEndpointRef": "b70ec5d0.6f8f08",
|
|
30
|
+
"x": 310,
|
|
31
|
+
"y": 40,
|
|
32
|
+
"wires": [["0ef929fde193cf4d"]]
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
"id": "0ef929fde193cf4d",
|
|
36
|
+
"type": "ps-receive-price",
|
|
37
|
+
"z": "d938c47f.3398f8",
|
|
38
|
+
"name": "Price Receiver",
|
|
39
|
+
"x": 140,
|
|
40
|
+
"y": 100,
|
|
41
|
+
"wires": [["5b6be1568744c6cf", "391ac08890e0dd40"]]
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
"id": "391ac08890e0dd40",
|
|
45
|
+
"type": "ps-strategy-lowest-price",
|
|
46
|
+
"z": "d938c47f.3398f8",
|
|
47
|
+
"name": "Lowest Price",
|
|
48
|
+
"fromTime": "00",
|
|
49
|
+
"toTime": "00",
|
|
50
|
+
"hoursOn": "12",
|
|
51
|
+
"doNotSplit": false,
|
|
52
|
+
"sendCurrentValueWhenRescheduling": true,
|
|
53
|
+
"outputIfNoSchedule": "true",
|
|
54
|
+
"outputOutsidePeriod": "true",
|
|
55
|
+
"x": 410,
|
|
56
|
+
"y": 400,
|
|
57
|
+
"wires": [["32f17ab2.927cf6"], ["526a6e89600f0f19"], ["ed7202ff.b5725"]]
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
"id": "32f17ab2.927cf6",
|
|
61
|
+
"type": "api-call-service",
|
|
62
|
+
"z": "d938c47f.3398f8",
|
|
63
|
+
"name": "Turn up",
|
|
64
|
+
"server": "ec4a12a1.b2be9",
|
|
65
|
+
"version": 3,
|
|
66
|
+
"debugenabled": true,
|
|
67
|
+
"service_domain": "climate",
|
|
68
|
+
"service": "set_temperature",
|
|
69
|
+
"entityId": "climate.varme_gulv_kjellerstue",
|
|
70
|
+
"data": "{\"temperature\":27}",
|
|
71
|
+
"dataType": "json",
|
|
72
|
+
"mergecontext": "",
|
|
73
|
+
"mustacheAltTags": false,
|
|
74
|
+
"outputProperties": [],
|
|
75
|
+
"queue": "last",
|
|
76
|
+
"x": 700,
|
|
77
|
+
"y": 340,
|
|
78
|
+
"wires": [[]]
|
|
79
|
+
},
|
|
80
|
+
{
|
|
81
|
+
"id": "526a6e89600f0f19",
|
|
82
|
+
"type": "api-call-service",
|
|
83
|
+
"z": "d938c47f.3398f8",
|
|
84
|
+
"name": "Turn down",
|
|
85
|
+
"server": "ec4a12a1.b2be9",
|
|
86
|
+
"version": 3,
|
|
87
|
+
"debugenabled": true,
|
|
88
|
+
"service_domain": "climate",
|
|
89
|
+
"service": "set_temperature",
|
|
90
|
+
"entityId": "climate.varme_gulv_kjellerstue",
|
|
91
|
+
"data": "{\"temperature\":25}",
|
|
92
|
+
"dataType": "json",
|
|
93
|
+
"mergecontext": "",
|
|
94
|
+
"mustacheAltTags": false,
|
|
95
|
+
"outputProperties": [],
|
|
96
|
+
"queue": "last",
|
|
97
|
+
"x": 710,
|
|
98
|
+
"y": 400,
|
|
99
|
+
"wires": [[]]
|
|
100
|
+
},
|
|
101
|
+
{
|
|
102
|
+
"id": "ed7202ff.b5725",
|
|
103
|
+
"type": "debug",
|
|
104
|
+
"z": "d938c47f.3398f8",
|
|
105
|
+
"name": "Lowest Price Schedule",
|
|
106
|
+
"active": true,
|
|
107
|
+
"tosidebar": true,
|
|
108
|
+
"console": false,
|
|
109
|
+
"tostatus": false,
|
|
110
|
+
"complete": "payload",
|
|
111
|
+
"targetType": "msg",
|
|
112
|
+
"statusVal": "",
|
|
113
|
+
"statusType": "auto",
|
|
114
|
+
"x": 750,
|
|
115
|
+
"y": 460,
|
|
116
|
+
"wires": []
|
|
117
|
+
},
|
|
118
|
+
{
|
|
119
|
+
"id": "82c86d92b7c9292c",
|
|
120
|
+
"type": "inject",
|
|
121
|
+
"z": "d938c47f.3398f8",
|
|
122
|
+
"name": "Send schedule",
|
|
123
|
+
"props": [
|
|
124
|
+
{
|
|
125
|
+
"p": "payload"
|
|
126
|
+
}
|
|
127
|
+
],
|
|
128
|
+
"repeat": "",
|
|
129
|
+
"crontab": "",
|
|
130
|
+
"once": false,
|
|
131
|
+
"onceDelay": 0.1,
|
|
132
|
+
"topic": "",
|
|
133
|
+
"payload": "{\"commands\":{\"sendSchedule\":true}}",
|
|
134
|
+
"payloadType": "json",
|
|
135
|
+
"x": 140,
|
|
136
|
+
"y": 260,
|
|
137
|
+
"wires": [["5b6be1568744c6cf", "391ac08890e0dd40"]]
|
|
138
|
+
},
|
|
139
|
+
{
|
|
140
|
+
"id": "b70ec5d0.6f8f08",
|
|
141
|
+
"type": "tibber-api-endpoint",
|
|
142
|
+
"feedUrl": "wss://api.tibber.com/v1-beta/gql/subscriptions",
|
|
143
|
+
"queryUrl": "https://api.tibber.com/v1-beta/gql",
|
|
144
|
+
"name": "Tibber API"
|
|
145
|
+
},
|
|
146
|
+
{
|
|
147
|
+
"id": "ec4a12a1.b2be9",
|
|
148
|
+
"type": "server",
|
|
149
|
+
"name": "Home Assistant",
|
|
150
|
+
"version": 2,
|
|
151
|
+
"addon": true,
|
|
152
|
+
"rejectUnauthorizedCerts": true,
|
|
153
|
+
"ha_boolean": "y|yes|true|on|home|open",
|
|
154
|
+
"connectionDelay": true,
|
|
155
|
+
"cacheJson": true,
|
|
156
|
+
"heartbeat": false,
|
|
157
|
+
"heartbeatInterval": 30
|
|
158
|
+
}
|
|
159
|
+
]
|
package/firebase.json
ADDED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "node-red-contrib-power-saver",
|
|
3
|
-
"version": "3.4.
|
|
3
|
+
"version": "3.4.1",
|
|
4
4
|
"description": "A module for Node-RED that you can use to turn on and off a switch based on power prices",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -31,7 +31,11 @@
|
|
|
31
31
|
"ps-elvia-tariff": "src/elvia/elvia-tariff.js",
|
|
32
32
|
"ps-elvia-add-tariff": "src/elvia/elvia-add-tariff.js",
|
|
33
33
|
"ps-general-add-tariff": "src/general-add-tariff.js"
|
|
34
|
-
}
|
|
34
|
+
},
|
|
35
|
+
"version": ">=2.0.0"
|
|
36
|
+
},
|
|
37
|
+
"engines": {
|
|
38
|
+
"node": ">=14.0.0"
|
|
35
39
|
},
|
|
36
40
|
"prettier": {
|
|
37
41
|
"printWidth": 120
|
|
@@ -41,19 +45,22 @@
|
|
|
41
45
|
"url": "https://github.com/ottopaulsen/node-red-contrib-power-saver.git"
|
|
42
46
|
},
|
|
43
47
|
"devDependencies": {
|
|
48
|
+
"@vuepress/bundler-webpack": "^2.0.0-alpha.1",
|
|
44
49
|
"@vuepress/plugin-register-components": "^2.0.0-beta.33",
|
|
45
50
|
"@vuepress/utils": "^2.0.0-beta.27",
|
|
46
|
-
"expect": "^27.
|
|
47
|
-
"mocha": "^
|
|
48
|
-
"node-red": "^
|
|
51
|
+
"expect": "^27.5.1",
|
|
52
|
+
"mocha": "^9.2.0",
|
|
53
|
+
"node-red": "^2.2.0",
|
|
49
54
|
"node-red-node-test-helper": "^0.2.7",
|
|
50
55
|
"patch-vue-directive-ssr": "^0.0.1",
|
|
51
|
-
"vuepress": "^2.0.0-beta.
|
|
56
|
+
"vuepress": "^2.0.0-beta.35",
|
|
57
|
+
"vuepress-webpack": "^2.0.0-beta.35"
|
|
52
58
|
},
|
|
53
59
|
"dependencies": {
|
|
54
|
-
"
|
|
60
|
+
"@vitejs/plugin-vue": "^2.2.0",
|
|
61
|
+
"floating-vue": "^2.0.0-beta.6",
|
|
55
62
|
"lodash.clonedeep": "^4.5.0",
|
|
56
|
-
"luxon": "^
|
|
57
|
-
"node-fetch": "^2.6.
|
|
63
|
+
"luxon": "^2.3.0",
|
|
64
|
+
"node-fetch": "^2.6.7"
|
|
58
65
|
}
|
|
59
66
|
}
|
package/public/404.html
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html>
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="utf-8">
|
|
5
|
+
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
6
|
+
<title>Page Not Found</title>
|
|
7
|
+
|
|
8
|
+
<style media="screen">
|
|
9
|
+
body { background: #ECEFF1; color: rgba(0,0,0,0.87); font-family: Roboto, Helvetica, Arial, sans-serif; margin: 0; padding: 0; }
|
|
10
|
+
#message { background: white; max-width: 360px; margin: 100px auto 16px; padding: 32px 24px 16px; border-radius: 3px; }
|
|
11
|
+
#message h3 { color: #888; font-weight: normal; font-size: 16px; margin: 16px 0 12px; }
|
|
12
|
+
#message h2 { color: #ffa100; font-weight: bold; font-size: 16px; margin: 0 0 8px; }
|
|
13
|
+
#message h1 { font-size: 22px; font-weight: 300; color: rgba(0,0,0,0.6); margin: 0 0 16px;}
|
|
14
|
+
#message p { line-height: 140%; margin: 16px 0 24px; font-size: 14px; }
|
|
15
|
+
#message a { display: block; text-align: center; background: #039be5; text-transform: uppercase; text-decoration: none; color: white; padding: 16px; border-radius: 4px; }
|
|
16
|
+
#message, #message a { box-shadow: 0 1px 3px rgba(0,0,0,0.12), 0 1px 2px rgba(0,0,0,0.24); }
|
|
17
|
+
#load { color: rgba(0,0,0,0.4); text-align: center; font-size: 13px; }
|
|
18
|
+
@media (max-width: 600px) {
|
|
19
|
+
body, #message { margin-top: 0; background: white; box-shadow: none; }
|
|
20
|
+
body { border-top: 16px solid #ffa100; }
|
|
21
|
+
}
|
|
22
|
+
</style>
|
|
23
|
+
</head>
|
|
24
|
+
<body>
|
|
25
|
+
<div id="message">
|
|
26
|
+
<h2>404</h2>
|
|
27
|
+
<h1>Page Not Found</h1>
|
|
28
|
+
<p>The specified file was not found on this website. Please check the URL for mistakes and try again.</p>
|
|
29
|
+
<h3>Why am I seeing this?</h3>
|
|
30
|
+
<p>This page was generated by the Firebase Command-Line Interface. To modify it, edit the <code>404.html</code> file in your project's configured <code>public</code> directory.</p>
|
|
31
|
+
</div>
|
|
32
|
+
</body>
|
|
33
|
+
</html>
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html>
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="utf-8">
|
|
5
|
+
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
6
|
+
<title>Welcome to Firebase Hosting</title>
|
|
7
|
+
|
|
8
|
+
<!-- update the version number as needed -->
|
|
9
|
+
<script defer src="/__/firebase/9.6.6/firebase-app-compat.js"></script>
|
|
10
|
+
<!-- include only the Firebase features as you need -->
|
|
11
|
+
<script defer src="/__/firebase/9.6.6/firebase-auth-compat.js"></script>
|
|
12
|
+
<script defer src="/__/firebase/9.6.6/firebase-database-compat.js"></script>
|
|
13
|
+
<script defer src="/__/firebase/9.6.6/firebase-firestore-compat.js"></script>
|
|
14
|
+
<script defer src="/__/firebase/9.6.6/firebase-functions-compat.js"></script>
|
|
15
|
+
<script defer src="/__/firebase/9.6.6/firebase-messaging-compat.js"></script>
|
|
16
|
+
<script defer src="/__/firebase/9.6.6/firebase-storage-compat.js"></script>
|
|
17
|
+
<script defer src="/__/firebase/9.6.6/firebase-analytics-compat.js"></script>
|
|
18
|
+
<script defer src="/__/firebase/9.6.6/firebase-remote-config-compat.js"></script>
|
|
19
|
+
<script defer src="/__/firebase/9.6.6/firebase-performance-compat.js"></script>
|
|
20
|
+
<!--
|
|
21
|
+
initialize the SDK after all desired features are loaded, set useEmulator to false
|
|
22
|
+
to avoid connecting the SDK to running emulators.
|
|
23
|
+
-->
|
|
24
|
+
<script defer src="/__/firebase/init.js?useEmulator=true"></script>
|
|
25
|
+
|
|
26
|
+
<style media="screen">
|
|
27
|
+
body { background: #ECEFF1; color: rgba(0,0,0,0.87); font-family: Roboto, Helvetica, Arial, sans-serif; margin: 0; padding: 0; }
|
|
28
|
+
#message { background: white; max-width: 360px; margin: 100px auto 16px; padding: 32px 24px; border-radius: 3px; }
|
|
29
|
+
#message h2 { color: #ffa100; font-weight: bold; font-size: 16px; margin: 0 0 8px; }
|
|
30
|
+
#message h1 { font-size: 22px; font-weight: 300; color: rgba(0,0,0,0.6); margin: 0 0 16px;}
|
|
31
|
+
#message p { line-height: 140%; margin: 16px 0 24px; font-size: 14px; }
|
|
32
|
+
#message a { display: block; text-align: center; background: #039be5; text-transform: uppercase; text-decoration: none; color: white; padding: 16px; border-radius: 4px; }
|
|
33
|
+
#message, #message a { box-shadow: 0 1px 3px rgba(0,0,0,0.12), 0 1px 2px rgba(0,0,0,0.24); }
|
|
34
|
+
#load { color: rgba(0,0,0,0.4); text-align: center; font-size: 13px; }
|
|
35
|
+
@media (max-width: 600px) {
|
|
36
|
+
body, #message { margin-top: 0; background: white; box-shadow: none; }
|
|
37
|
+
body { border-top: 16px solid #ffa100; }
|
|
38
|
+
}
|
|
39
|
+
</style>
|
|
40
|
+
</head>
|
|
41
|
+
<body>
|
|
42
|
+
<div id="message">
|
|
43
|
+
<h2>Welcome</h2>
|
|
44
|
+
<h1>Firebase Hosting Setup Complete</h1>
|
|
45
|
+
<p>You're seeing this because you've successfully setup Firebase Hosting. Now it's time to go build something extraordinary!</p>
|
|
46
|
+
<a target="_blank" href="https://firebase.google.com/docs/hosting/">Open Hosting Documentation</a>
|
|
47
|
+
</div>
|
|
48
|
+
<p id="load">Firebase SDK Loading…</p>
|
|
49
|
+
|
|
50
|
+
<script>
|
|
51
|
+
document.addEventListener('DOMContentLoaded', function() {
|
|
52
|
+
const loadEl = document.querySelector('#load');
|
|
53
|
+
// // 🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥
|
|
54
|
+
// // The Firebase SDK is initialized and available here!
|
|
55
|
+
//
|
|
56
|
+
// firebase.auth().onAuthStateChanged(user => { });
|
|
57
|
+
// firebase.database().ref('/path/to/ref').on('value', snapshot => { });
|
|
58
|
+
// firebase.firestore().doc('/foo/bar').get().then(() => { });
|
|
59
|
+
// firebase.functions().httpsCallable('yourFunction')().then(() => { });
|
|
60
|
+
// firebase.messaging().requestPermission().then(() => { });
|
|
61
|
+
// firebase.storage().ref('/path/to/ref').getDownloadURL().then(() => { });
|
|
62
|
+
// firebase.analytics(); // call to activate
|
|
63
|
+
// firebase.analytics().logEvent('tutorial_completed');
|
|
64
|
+
// firebase.performance(); // call to activate
|
|
65
|
+
//
|
|
66
|
+
// // 🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥
|
|
67
|
+
|
|
68
|
+
try {
|
|
69
|
+
let app = firebase.app();
|
|
70
|
+
let features = [
|
|
71
|
+
'auth',
|
|
72
|
+
'database',
|
|
73
|
+
'firestore',
|
|
74
|
+
'functions',
|
|
75
|
+
'messaging',
|
|
76
|
+
'storage',
|
|
77
|
+
'analytics',
|
|
78
|
+
'remoteConfig',
|
|
79
|
+
'performance',
|
|
80
|
+
].filter(feature => typeof app[feature] === 'function');
|
|
81
|
+
loadEl.textContent = `Firebase SDK loaded with ${features.join(', ')}`;
|
|
82
|
+
} catch (e) {
|
|
83
|
+
console.error(e);
|
|
84
|
+
loadEl.textContent = 'Error loading the Firebase SDK, check the console.';
|
|
85
|
+
}
|
|
86
|
+
});
|
|
87
|
+
</script>
|
|
88
|
+
</body>
|
|
89
|
+
</html>
|
|
@@ -10,8 +10,6 @@ const {
|
|
|
10
10
|
} = require("../src/strategy-heat-capacitor-functions");
|
|
11
11
|
const converted_prices = require("./data/converted-prices.json");
|
|
12
12
|
const decreasing_end_prices = require("./data/tibber-decreasing2-24h.json");
|
|
13
|
-
const { cloneDeep } = require("lodash");
|
|
14
|
-
const { stringContaining } = require("expect");
|
|
15
13
|
|
|
16
14
|
describe("Test heat capacitor strategy functions", () => {
|
|
17
15
|
let prices, decreasing_24h_prices, start_date, buy_pattern, sell_pattern;
|
|
@@ -2,7 +2,7 @@ const { DateTime } = require("luxon");
|
|
|
2
2
|
const expect = require("expect");
|
|
3
3
|
const { getBestContinuous, getBestX } = require("../src/strategy-lowest-price-functions");
|
|
4
4
|
const convertedPrices = require("./data/converted-prices.json");
|
|
5
|
-
const
|
|
5
|
+
const cloneDeep = require("lodash.clonedeep");
|
|
6
6
|
|
|
7
7
|
describe("strategy-utils", () => {
|
|
8
8
|
it("can find best x", () => {
|
package/test/utils.test.js
CHANGED
|
@@ -5,14 +5,12 @@ const {
|
|
|
5
5
|
sortedIndex,
|
|
6
6
|
firstOn,
|
|
7
7
|
getDiffToNextOn,
|
|
8
|
-
isOnOffSequencesOk,
|
|
9
8
|
getSavings,
|
|
10
9
|
countAtEnd,
|
|
11
10
|
makeSchedule,
|
|
12
11
|
fillArray,
|
|
13
12
|
extractPlanForDate,
|
|
14
13
|
isSameDate,
|
|
15
|
-
getStartAtIndex,
|
|
16
14
|
} = require("../src/utils");
|
|
17
15
|
|
|
18
16
|
describe("utils", () => {
|
|
File without changes
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
.config>p[data-v-78951500]{margin:0;padding:0}td[data-v-78951500],th[data-v-78951500]{margin:2px 4px;padding:2px 4px;font-size:small}.highlightSequence[data-v-78951500]{background-color:#87cefa}.highlightSaving[data-v-78951500]{background-color:#ff0}.highlightBoth[data-v-78951500]{background-color:#90ee90}.belowMin[data-v-78951500]{color:red}.selectable[data-v-78951500]{cursor:pointer}.sepcol[data-v-78951500]{background-color:#a9a9a9}
|