Hi!
I was able to use ‘powersaver’ nodes with epex data in nodered to get the cheapest hours:
here you have the code:
[{"id":"153f65b59d1179db","type":"ps-strategy-lowest-price","z":"9033a393.73d5a","name":"Lowest 3h Price","fromTime":"22","toTime":"22","hoursOn":"3","maxPrice":"","doNotSplit":false,"sendCurrentValueWhenRescheduling":true,"outputValueForOn":"true","outputValueForOff":"true","outputValueForOntype":"bool","outputValueForOfftype":"bool","outputIfNoSchedule":"false","outputOutsidePeriod":"false","contextStorage":"memory","x":840,"y":840,"wires":[["dea65f8e2836d43a","acabc9ced064f374"],["49416e2450c613bd","c1219a4d08aceda2"],[]]},{"id":"4df208401ec5d0b6","type":"ps-strategy-lowest-price","z":"9033a393.73d5a","name":"Lowest 8Price","fromTime":"22","toTime":"22","hoursOn":"8","maxPrice":"","doNotSplit":false,"sendCurrentValueWhenRescheduling":true,"outputValueForOn":"true","outputValueForOff":"false","outputValueForOntype":"bool","outputValueForOfftype":"bool","outputIfNoSchedule":"true","outputOutsidePeriod":"false","contextStorage":"memory","x":840,"y":1060,"wires":[["b76b45f5e3eac781","7ccdde304b6f55eb"],["94fdbedf12f3f2b1","7ae85dc21f672f4f"],[]]},{"id":"cf6656888c0fe1ac","type":"inject","z":"9033a393.73d5a","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"00 21 * * *","once":true,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":130,"y":760,"wires":[["3af57e696732e4f0"]]},{"id":"1dfd79141aa50b10","type":"function","z":"9033a393.73d5a","name":"convert EPEX data","func":"// Extract the original data array\nlet data = msg.data.attributes.data;\n\n// Initialize the new priceData array\nlet priceData = [];\n\n// Loop through each data point and transform it\nfor (let i = 0; i < data.length; i++) {\n let dataPoint = data[i];\n let newDataPoint = {\n value: dataPoint.price_ct_per_kwh / 100, // Convert price to dollars/kWh\n start: dataPoint.start_time // Use the start_time as is\n };\n priceData.push(newDataPoint);\n}\n\n// Assign the new priceData array to msg.payload.priceData\nmsg.payload = { priceData: priceData };\n\n// Return the modified message\nreturn msg;","outputs":1,"timeout":0,"noerr":0,"initialize":"","finalize":"","libs":[],"x":610,"y":840,"wires":[["4df208401ec5d0b6","153f65b59d1179db"]]},{"id":"3af57e696732e4f0","type":"api-current-state","z":"9033a393.73d5a","name":"","server":"1284480.46e1db8","version":3,"outputs":1,"halt_if":"","halt_if_type":"str","halt_if_compare":"is","entity_id":"sensor.epex_spot_data_price","state_type":"str","blockInputOverrides":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"entity"}],"for":"0","forType":"num","forUnits":"minutes","override_topic":false,"state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","x":310,"y":840,"wires":[["1dfd79141aa50b10"]]},{"id":"1284480.46e1db8","type":"server","name":"Home Assistant","addon":true,"rejectUnauthorizedCerts":true,"ha_boolean":"","connectionDelay":false,"cacheJson":false,"heartbeat":false,"heartbeatInterval":"","statusSeparator":"","enableGlobalContextStore":false}]