Energy automation - some help needed

Hi,

I spend some time adapting a script (from gust4vsson) to automise tibber pricing to device actions.
So far it mainly works well, I only would like to add a feature and can’t figure out how.

Currently, I have high and low treshold prices which are compared to the tibber pricing input.
The output triggers a binary sensor (runApplianceLow and runApplianceHigh).
That works fine.

However, I would like to add:

  1. An overview at what time(s) these binary sensors will be activated.
  2. A option to select a x-hours cheapest timeframe sensor + time when that occurs

Hopefully somebody is much more knowledgable than I am and can help me.
I am trying to learn :slight_smile:

Node-red code:

[{"id":"151dcfabb5092372","type":"tab","label":"Flow 1","disabled":false,"info":"","env":[]},{"id":"b42094bc95f75991","type":"tibber-data","z":"151dcfabb5092372","name":"Get Todays Prices","active":true,"apiEndpointRef":"70b33fa87d346e0c","queryName":"getTodaysEnergyPrices","homeId":"","energyResolution":"HOURLY","lastCount":10,"x":830,"y":600,"wires":[["a88f0c25b23649c3"]]},{"id":"c8586b8c6b0888c2","type":"tibber-data","z":"151dcfabb5092372","name":"Get Tomorrows Prices","active":true,"apiEndpointRef":"70b33fa87d346e0c","queryName":"getTomorrowsEnergyPrices","homeId":"","energyResolution":"HOURLY","lastCount":10,"x":840,"y":660,"wires":[["02816dfb1de84770"]]},{"id":"94031367ee895412","type":"inject","z":"151dcfabb5092372","name":"Every hour","props":[],"repeat":"","crontab":"0 0-23 * * *","once":true,"onceDelay":"0.1","topic":"","x":130,"y":420,"wires":[["03e9877ad2bbd90d","67414fa995ba8526"]]},{"id":"932b20aa72e1d511","type":"time-range-switch","z":"151dcfabb5092372","name":"","lat":"","lon":"","startTime":"00:00","endTime":"12:59","startOffset":0,"endOffset":0,"x":610,"y":660,"wires":[[],["c8586b8c6b0888c2"]]},{"id":"93b1305397c266c4","type":"inject","z":"151dcfabb5092372","name":"00:00","props":[],"repeat":"","crontab":"00 00 * * *","once":true,"onceDelay":"1","topic":"","x":120,"y":140,"wires":[["386bf62c36f51067"]]},{"id":"386bf62c36f51067","type":"tibber-data","z":"151dcfabb5092372","name":"getHomes","active":true,"apiEndpointRef":"70b33fa87d346e0c","queryName":"getHomes","homeId":"{ payload.[0] }","energyResolution":"DAILY","lastCount":10,"x":330,"y":140,"wires":[["2661aec5a1e2a6ab"]]},{"id":"ee73b3e7791724a2","type":"debug","z":"151dcfabb5092372","name":"HomeID","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":760,"y":140,"wires":[]},{"id":"2661aec5a1e2a6ab","type":"function","z":"151dcfabb5092372","name":"set Home ID","func":"flow.set(\"tibberHome\", msg.payload[0].id)\n\nmsg.payload = msg.payload[0].id;\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":550,"y":140,"wires":[["ee73b3e7791724a2"]]},{"id":"c3c5eb32792071ab","type":"function","z":"151dcfabb5092372","name":"get Home ID","func":"msg.payload = { \"homeId\": flow.get(\"tibberHome\") };\n\nreturn msg;\n","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":610,"y":600,"wires":[["b42094bc95f75991","932b20aa72e1d511"]]},{"id":"110a93edac90adae","type":"catch","z":"151dcfabb5092372","name":"","scope":null,"uncaught":false,"x":120,"y":740,"wires":[["4d93e20720af1b48"]]},{"id":"4d93e20720af1b48","type":"debug","z":"151dcfabb5092372","name":"Errors","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":310,"y":740,"wires":[]},{"id":"97e3bd6bb7962c46","type":"function","z":"151dcfabb5092372","name":"Set Price Thresholds","func":"const ha = global.get('homeassistant').homeAssistant.states;\nconst priceThresholdLow = ha[\"input_number.electricityprice_treshold_low\"].state;\nconst priceThresholdHigh = ha[\"input_number.electricityprice_treshold_high\"].state;\nconst priceLow = ha[\"input_number.electricityprice_low\"].state;\nconst priceHigh = ha[\"input_number.electricityprice_high\"].state;\n\nflow.set(\"priceThresholdLow\", priceThresholdLow);\nflow.set(\"priceThresholdHigh\", priceThresholdHigh);\nflow.set(\"priceLow\", priceLow);\nflow.set(\"priceHigh\", priceHigh);\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":580,"y":260,"wires":[[]]},{"id":"67414fa995ba8526","type":"delay","z":"151dcfabb5092372","name":"","pauseType":"delay","timeout":"5","timeoutUnits":"seconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"allowrate":false,"outputs":1,"x":340,"y":420,"wires":[["97e3bd6bb7962c46"]]},{"id":"b309b954a8c92295","type":"comment","z":"151dcfabb5092372","name":"Ontvang en zet Home ID van Tibber elke dag om 00:00 in de stroomvariabele.","info":"Huis-ID wordt opgehaald uit Tibber\nbij het starten van Home Assistant\nen elke dag om 00:00 uur","x":310,"y":100,"wires":[]},{"id":"cab9ad37e539a7b6","type":"comment","z":"151dcfabb5092372","name":"Update prijzen, wanneer grenswaarde verandert. Verwerk nieuwe waarden voor gebruik.","info":"","x":300,"y":220,"wires":[]},{"id":"a8d94ed6347dac23","type":"comment","z":"151dcfabb5092372","name":"Elk uur prijzen opvragen en werking updaten (onder grenswaarde = werking, boven grenswaarde = stop).","info":"","x":580,"y":560,"wires":[]},{"id":"98d0d56e1e91aaf9","type":"comment","z":"151dcfabb5092372","name":"Forceer veel toestanden in verschillende knooppunten die door HA worden gebruikt.","info":"","x":1390,"y":20,"wires":[]},{"id":"ef26c02ab6cfad98","type":"comment","z":"151dcfabb5092372","name":"Vang vreemde fouten op.","info":"","x":170,"y":700,"wires":[]},{"id":"61274c8ca55dd805","type":"comment","z":"151dcfabb5092372","name":"Node Red moet eerst verbinding maken met HA","info":"","x":460,"y":380,"wires":[]},{"id":"4ef8d4c617223676","type":"comment","z":"151dcfabb5092372","name":"In deze functie knettert de magie.","info":"","x":870,"y":360,"wires":[]},{"id":"03e9877ad2bbd90d","type":"delay","z":"151dcfabb5092372","name":"","pauseType":"queue","timeout":"5","timeoutUnits":"seconds","rate":"1","nbRateUnits":"20","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":true,"allowrate":false,"outputs":1,"x":400,"y":600,"wires":[["c3c5eb32792071ab"]]},{"id":"bd4eae6fce329382","type":"ha-button","z":"151dcfabb5092372","name":"Update Price changes","version":0,"debugenabled":false,"outputs":1,"entityConfig":"8701b24b8daec680","outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"topic","propertyType":"msg","value":"","valueType":"triggerId"},{"property":"data","propertyType":"msg","value":"","valueType":"entity"}],"x":160,"y":260,"wires":[["97e3bd6bb7962c46","03e9877ad2bbd90d"]]},{"id":"9373466669f76102","type":"comment","z":"151dcfabb5092372","name":"Loopt een keer per uur.","info":"","x":160,"y":380,"wires":[]},{"id":"3ccc9a57214252d2","type":"debug","z":"151dcfabb5092372","name":"Process Data","active":true,"tosidebar":true,"console":true,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":920,"y":280,"wires":[]},{"id":"a88f0c25b23649c3","type":"change","z":"151dcfabb5092372","name":"Change payload to today","rules":[{"t":"move","p":"payload","pt":"msg","to":"today","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":850,"y":460,"wires":[["7b651aa23481e985"]]},{"id":"02816dfb1de84770","type":"change","z":"151dcfabb5092372","name":"Change payload to tomorrow","rules":[{"t":"move","p":"payload","pt":"msg","to":"tomorrow","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":860,"y":500,"wires":[["7b651aa23481e985"]]},{"id":"7b651aa23481e985","type":"function","z":"151dcfabb5092372","name":"Process Data","func":"// FUNCTION NODE FOR FETCHING PRICES NOW AND TOMORROW.\n// CALCULATING MIN, MAX, THRESHOLDS.\n// SETTING RUNAPPLIANCE LOW AND HIGH ACCORDINGLY.\n\n// TODAY\n\nif (msg.today != null) {\n\n    //Variables\n    const data = msg.today;\n\n    const now = new Date();\n\n    const onehour = new Date();\n    onehour.setHours(onehour.getHours() + 1);\n\n    const twohour = new Date();\n    twohour.setHours(twohour.getHours() + 2);\n\n    const threehour = new Date();\n    threehour.setHours(threehour.getHours() + 3);\n\n    const fourhour = new Date();\n    fourhour.setHours(fourhour.getHours() + 4);\n\n    const fivehour = new Date();\n    fivehour.setHours(fivehour.getHours() + 5);\n\n    const sixhour = new Date();\n    sixhour.setHours(sixhour.getHours() + 6);\n\n    const sevenhour = new Date();\n    sevenhour.setHours(sevenhour.getHours() + 7);\n\n    const eighthour = new Date();\n    eighthour.setHours(eighthour.getHours() + 8);\n\n    const ninehour = new Date();\n    ninehour.setHours(ninehour.getHours() + 9);\n\n    const tenhour = new Date();\n    tenhour.setHours(tenhour.getHours() + 10);\n\n    const elevenhour = new Date();\n    elevenhour.setHours(elevenhour.getHours() + 11);\n\n    const twelvehour = new Date();\n    twelvehour.setHours(twelvehour.getHours() + 12);\n\n    const thirteenhour = new Date();\n    thirteenhour.setHours(thirteenhour.getHours() + 13);\n\n    const fourteenhour = new Date();\n    fourteenhour.setHours(fourteenhour.getHours() + 14);\n\n    const fifteenhour = new Date();\n    fifteenhour.setHours(fifteenhour.getHours() + 15);\n\n    const sixteenhour = new Date();\n    sixteenhour.setHours(sixteenhour.getHours() + 16);\n\n    const seventeenhour = new Date();\n    seventeenhour.setHours(seventeenhour.getHours() + 17);\n\n    const eightteenhour = new Date();\n    eightteenhour.setHours(eightteenhour.getHours() + 18);\n\n    const nineteenhour = new Date();\n    nineteenhour.setHours(nineteenhour.getHours() + 19);\n\n    const twentyhour = new Date();\n    twentyhour.setHours(twentyhour.getHours() + 20);\n\n    const twentyonehour = new Date();\n    twentyonehour.setHours(twentyonehour.getHours() + 21);\n\n    const twentytwohour = new Date();\n    twentytwohour.setHours(twentytwohour.getHours() + 22);\n\n    const twentythreehour = new Date();\n    twentythreehour.setHours(twentytwohour.getHours() + 23);\n\n    const twentyfourhour = new Date();\n    twentyfourhour.setHours(twentytwohour.getHours() + 24);\n\n    const findTimestampnow = now.setMinutes(0, 0, 0);\n    const findTimestamponehour = onehour.setMinutes(0, 0, 0);\n    const findTimestamptwohour = twohour.setMinutes(0, 0, 0);\n    const findTimestampthreehour = threehour.setMinutes(0, 0, 0);\n    const findTimestampfourhour = fourhour.setMinutes(0, 0, 0);\n    const findTimestampfivehour = fivehour.setMinutes(0, 0, 0);\n    const findTimestampsixhour = sixhour.setMinutes(0, 0, 0);\n\n\n    //find price now\n    let priceNow = data.find(e => {\n        return (new Date(e.startsAt)).valueOf() == findTimestampnow;\n    });\n\n    //find price in one hour\n    let price1hour = data.find(e => {\n        return (new Date(e.startsAt)).valueOf() == findTimestamponehour;\n    });\n\n    //find price in two hours\n    let price2hour = data.find(e => {\n        return (new Date(e.startsAt)).valueOf() == findTimestamptwohour;\n    });\n\n    //find price in three hours\n    let price3hour = data.find(e => {\n        return (new Date(e.startsAt)).valueOf() == findTimestampthreehour;\n    });\n\n    //find price in four hours\n    let price4hour = data.find(e => {\n        return (new Date(e.startsAt)).valueOf() == findTimestampfourhour;\n    });\n\n    //find price in five hours\n    let price5hour = data.find(e => {\n        return (new Date(e.startsAt)).valueOf() == findTimestampfivehour;\n    });\n\n    //find price in six hours\n    let price6hour = data.find(e => {\n        return (new Date(e.startsAt)).valueOf() == findTimestampsixhour;\n    });\n\n    //Now lets parse the days min and max prices\n    let prices = msg.today\n    let minTotal = prices[0].total\n    let maxTotal = prices[0].total\n    let average = minTotal + (maxTotal - minTotal)\n    let priceActual = priceNow.total\n\n    prices.forEach(el => {\n        if (el.total < minTotal) minTotal = el.total\n    })\n\n    prices.forEach(el => {\n        if (el.total > maxTotal) maxTotal = el.total\n    })\n\n    //Price threshold, are we ok to run whatever needs to be run?\n    let runApplianceLow = false;\n    let runApplianceHigh = false;\n    let runonlowestPrice = false;    \n    let thresholdLow = minTotal + ((maxTotal - minTotal) * (flow.get(\"priceThresholdLow\") / 100))\n    let thresholdHigh = minTotal + ((maxTotal - minTotal) * (flow.get(\"priceThresholdHigh\") / 100))\n\n    //Run appliance? Either from threshold or set price levels\n    if (priceActual <= thresholdLow) {\n        runApplianceLow = true;\n    } else if (priceActual <= flow.get(\"priceLow\")) {\n        runApplianceLow = true;\n    }\n\n    if (priceActual <= thresholdHigh) {\n        runApplianceHigh = true;\n    } else if (priceActual <= flow.get(\"priceHigh\")) {\n        runApplianceHigh = true;\n    }\n    \n    if (priceActual <= minTotal) {\n        runonlowestPrice = true\n    } else { runonlowestPrice = false\n    }\n\n    //Null old payloads\n    msg.payload = null;\n    msg.today = null;\n\n    //Build our payload\n    msg.payload  = {\n        priceActual,\n        minTotal,\n        maxTotal,\n        average,\n        runApplianceLow,\n        runApplianceHigh,\n        runonlowestPrice,\n        thresholdLow,\n        thresholdHigh\n        \n    }\n\n    if (typeof priceNow != \"undefined\") {\n        msg.payload[\"priceNow\"] = priceNow;\n    }\n\n    if (typeof price1hour != \"undefined\") {\n        msg.payload[\"price1hour\"] = price1hour;\n    }\n\n    if (typeof price2hour != \"undefined\") {\n        msg.payload[\"price2hour\"] = price2hour;\n    }\n\n    if (typeof price3hour != \"undefined\") {\n        msg.payload[\"price3hour\"] = price3hour;\n    }\n\n    if (typeof price4hour != \"undefined\") {\n        msg.payload[\"price4hour\"] = price4hour;\n    }\n\n    if (typeof price5hour != \"undefined\") {\n        msg.payload[\"price5hour\"] = price5hour;\n    }\n\n    if (typeof price6hour != \"undefined\") {\n        msg.payload[\"price6hour\"] = price6hour;\n    } \n\n    //Jalla let go\n    return msg;\n}\n\n//TOMORROW\n\nif (msg.tomorrow != null) {\n\n    //Variables\n    const data = msg.tomorrow;\n\n    const tom = new Date();\n    tom.setHours(tom.getHours() + 24);\n\n    const onehour = new Date();\n    onehour.setHours(onehour.getHours() + 1);\n\n    const twohour = new Date();\n    twohour.setHours(twohour.getHours() + 2);\n\n    const threehour = new Date();\n    threehour.setHours(threehour.getHours() + 3);\n\n    const fourhour = new Date();\n    fourhour.setHours(fourhour.getHours() + 4);\n\n    const fivehour = new Date();\n    fivehour.setHours(fivehour.getHours() + 5);\n\n    const sixhour = new Date();\n    sixhour.setHours(sixhour.getHours() + 6);    \n\n\n    const findTimestamptom = tom.setMinutes(0, 0, 0);\n    const findTimestamponehour = onehour.setMinutes(0, 0, 0);\n    const findTimestamptwohour = twohour.setMinutes(0, 0, 0);\n    const findTimestampthreehour = threehour.setMinutes(0, 0, 0);\n    const findTimestampfourhour = fourhour.setMinutes(0, 0, 0);\n    const findTimestampfivehour = fivehour.setMinutes(0, 0, 0);\n    const findTimestampsixhour = sixhour.setMinutes(0, 0, 0);\n\n    //find price tomorrow\n    let priceTomorrow = data.find(e => {\n        return (new Date(e.startsAt)).valueOf() == findTimestamptom;\n    });\n\n    //find price in one hour\n    let price1hour = data.find(e => {\n        return (new Date(e.startsAt)).valueOf() == findTimestamponehour;\n    });\n\n    //find price in two hours\n    let price2hour = data.find(e => {\n        return (new Date(e.startsAt)).valueOf() == findTimestamptwohour;\n    });\n\n    //find price in three hours\n    let price3hour = data.find(e => {\n        return (new Date(e.startsAt)).valueOf() == findTimestampthreehour;\n    });\n\n    //find price in four hours\n    let price4hour = data.find(e => {\n        return (new Date(e.startsAt)).valueOf() == findTimestampfourhour;\n    });\n\n    //find price in five hours\n    let price5hour = data.find(e => {\n        return (new Date(e.startsAt)).valueOf() == findTimestampfivehour;\n    });\n\n    //find price in six hours\n    let price6hour = data.find(e => {\n        return (new Date(e.startsAt)).valueOf() == findTimestampsixhour;\n    });\n\n\n    //Min max prices tomorrow\n    let prices = msg.tomorrow\n    let minTotalTom = prices[0].total\n    let maxTotalTom = prices[0].total\n    let averageTom = minTotalTom + (maxTotalTom - minTotalTom)\n\n    prices.forEach(el => {\n        if (el.total < minTotalTom) minTotalTom = el.total\n    })\n\n    prices.forEach(el => {\n        if (el.total > maxTotalTom) maxTotalTom = el.total\n    })\n\n    //Thresholds tomorrow\n    let thresholdLowTom = minTotalTom + ((maxTotalTom - minTotalTom) * (flow.get(\"priceThresholdLow\") / 100))\n    let thresholdHighTom = minTotalTom + ((maxTotalTom - minTotalTom) * (flow.get(\"priceThresholdHigh\") / 100))\n\n\n    //Null the old payloads\n    msg.payload = null;\n    msg.tomorrow = null;\n\n    //Build our payload\n    if (typeof priceTomorrow != \"undefined\") {\n        msg.payload = {\n            priceTomorrow,\n            minTotalTom,\n            maxTotalTom,\n            averageTom,\n            thresholdLowTom,\n            thresholdHighTom\n        }\n    }\n\n    if (typeof price1hour != \"undefined\") {\n        msg.payload[\"price1hour\"] = price1hour;\n    }\n\n    if (typeof price2hour != \"undefined\") {\n        msg.payload[\"price2hour\"] = price2hour;\n    }\n\n    if (typeof price3hour != \"undefined\") {\n        msg.payload[\"price3hour\"] = price3hour;\n    }\n\n    if (typeof price4hour != \"undefined\") {\n        msg.payload[\"price4hour\"] = price4hour;\n    }\n\n    if (typeof price5hour != \"undefined\") {\n        msg.payload[\"price5hour\"] = price5hour;\n    }\n\n    if (typeof price6hour != \"undefined\") {\n        msg.payload[\"price6hour\"] = price6hour;\n    }    \n\n    //Jalla let go\n    return msg;\n}","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":920,"y":400,"wires":[["3ccc9a57214252d2","4a0ca45dba6dcdf6","b04b58a2c5a604ce","0c70906441b72a2d","d03c1f53222e6156","016cd4142ca507ae","4429b6b1987d9127","b20c682b49b259f8","5aa59a2efd651100","bb6738711786f0a2","55b013d71cd3c49f","4d1ac8959b2b7ac5","e3bca1e8b872fd3f","b10a8ce1f02d4379","17793c2182ae7563","f31d03ccd4442e41"]]},{"id":"4a0ca45dba6dcdf6","type":"ha-sensor","z":"151dcfabb5092372","name":"Price now","entityConfig":"8930b7772c84df5f","version":0,"state":"payload.priceNow.total","stateType":"msg","attributes":[{"property":"Mintotal","value":"payload.minTotal","valueType":"msg"},{"property":"Maxtotal","value":"payload.maxTotal","valueType":"msg"},{"property":"level","value":"payload.priceNow.level","valueType":"msg"},{"property":"Average","value":"payload.average","valueType":"msg"},{"property":"Actual","value":"payload.priceActual","valueType":"msg"}],"inputOverride":"allow","outputProperties":[],"x":1380,"y":320,"wires":[[]]},{"id":"b04b58a2c5a604ce","type":"ha-sensor","z":"151dcfabb5092372","name":"Price in 1 hour","entityConfig":"887f061916c54562","version":0,"state":"payload.price1hour.total","stateType":"msg","attributes":[],"inputOverride":"allow","outputProperties":[],"x":1180,"y":640,"wires":[[]]},{"id":"0c70906441b72a2d","type":"ha-sensor","z":"151dcfabb5092372","name":"Price in 2 hours","entityConfig":"375aa345a1202971","version":0,"state":"payload.price2hour.total","stateType":"msg","attributes":[],"inputOverride":"allow","outputProperties":[],"x":1180,"y":700,"wires":[[]]},{"id":"d03c1f53222e6156","type":"ha-sensor","z":"151dcfabb5092372","name":"Price in 3 hours","entityConfig":"eb0d4cb5d9d5e7bd","version":0,"state":"payload.price3hour.total","stateType":"msg","attributes":[],"inputOverride":"allow","outputProperties":[],"x":1180,"y":760,"wires":[[]]},{"id":"016cd4142ca507ae","type":"ha-sensor","z":"151dcfabb5092372","name":"Price in 4 hours","entityConfig":"e1956e8443b7732b","version":0,"state":"payload.price4hour.total","stateType":"msg","attributes":[],"inputOverride":"allow","outputProperties":[],"x":1180,"y":820,"wires":[[]]},{"id":"4429b6b1987d9127","type":"ha-sensor","z":"151dcfabb5092372","name":"Price in 5 hours","entityConfig":"cb2721b09234eda7","version":0,"state":"payload.price5hour.total","stateType":"msg","attributes":[],"inputOverride":"allow","outputProperties":[],"x":1180,"y":880,"wires":[[]]},{"id":"b20c682b49b259f8","type":"ha-sensor","z":"151dcfabb5092372","name":"Price in 6 hours","entityConfig":"10d5cb062d73c8b2","version":0,"state":"payload.price6hour.total","stateType":"msg","attributes":[],"inputOverride":"allow","outputProperties":[],"x":1180,"y":940,"wires":[[]]},{"id":"5aa59a2efd651100","type":"ha-binary-sensor","z":"151dcfabb5092372","name":"runApplianceLow","entityConfig":"d789d71f44158785","version":0,"state":"payload.runApplianceLow","stateType":"msg","attributes":[],"inputOverride":"allow","outputProperties":[],"x":1190,"y":360,"wires":[[]]},{"id":"bb6738711786f0a2","type":"ha-binary-sensor","z":"151dcfabb5092372","name":"runApplianceHigh","entityConfig":"8f4fb67ec1f422eb","version":0,"state":"payload.runApplianceHigh","stateType":"msg","attributes":[],"inputOverride":"allow","outputProperties":[],"x":1190,"y":420,"wires":[[]]},{"id":"55b013d71cd3c49f","type":"ha-sensor","z":"151dcfabb5092372","name":"Threshold Price Low","entityConfig":"28d307ed2064f1d6","version":0,"state":"payload.thresholdLow","stateType":"msg","attributes":[],"inputOverride":"allow","outputProperties":[],"x":1200,"y":60,"wires":[[]]},{"id":"4d1ac8959b2b7ac5","type":"ha-sensor","z":"151dcfabb5092372","name":"Threshold Price High","entityConfig":"8786856ed61503df","version":0,"state":"payload.thresholdHigh","stateType":"msg","attributes":[],"inputOverride":"allow","outputProperties":[],"x":1200,"y":120,"wires":[[]]},{"id":"e3bca1e8b872fd3f","type":"ha-sensor","z":"151dcfabb5092372","name":"Threshold Price Low Tomorrow","entityConfig":"f45a19086955235f","version":0,"state":"payload.thresholdLowTom","stateType":"msg","attributes":[],"inputOverride":"allow","outputProperties":[],"x":1230,"y":180,"wires":[[]]},{"id":"b10a8ce1f02d4379","type":"ha-sensor","z":"151dcfabb5092372","name":"Threshold Price High Tomorrow","entityConfig":"c2c4ce1a4eeb4bac","version":0,"state":"payload.thresholdHighTom","stateType":"msg","attributes":[],"inputOverride":"allow","outputProperties":[],"x":1230,"y":240,"wires":[[]]},{"id":"17793c2182ae7563","type":"ha-sensor","z":"151dcfabb5092372","name":"Price tomorrow","entityConfig":"1d4fcf6095bc6e5b","version":0,"state":"payload.priceTomorrow.total","stateType":"msg","attributes":[{"property":"Mintotal","value":"payload.minTotalTom","valueType":"msg"},{"property":"Maxtotal","value":"payload.maxTotalTom","valueType":"msg"},{"property":"level","value":"payload.priceTomorrow.level","valueType":"msg"},{"property":"Average","value":"payload.averageTom","valueType":"msg"}],"inputOverride":"allow","outputProperties":[],"x":1400,"y":380,"wires":[[]]},{"id":"8a25e3d7ef1929cc","type":"debug","z":"151dcfabb5092372","name":"Input price/timings","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":1990,"y":260,"wires":[]},{"id":"f31d03ccd4442e41","type":"ha-binary-sensor","z":"151dcfabb5092372","name":"Run on lowest price","entityConfig":"8b65be0177b2c72d","version":0,"state":"payload.runonlowestPrice","stateType":"msg","attributes":[],"inputOverride":"allow","outputProperties":[],"x":1190,"y":300,"wires":[[]]},{"id":"70b33fa87d346e0c","type":"tibber-api-endpoint","queryUrl":"https://api.tibber.com/v1-beta/gql","feedTimeout":"60","name":"Tibber Baby"},{"id":"8701b24b8daec680","type":"ha-entity-config","server":"1101e9cb.075866","deviceConfig":"","name":"Update price changes","version":"6","entityType":"button","haConfig":[{"property":"name","value":"Update price changes"},{"property":"icon","value":"mdi:gesture-tap-button"},{"property":"entity_category","value":""},{"property":"device_class","value":""}],"resend":false,"debugEnabled":false},{"id":"8930b7772c84df5f","type":"ha-entity-config","server":"1101e9cb.075866","deviceConfig":"","name":"sensor config for Price now","version":"6","entityType":"sensor","haConfig":[{"property":"name","value":"Price now"},{"property":"icon","value":"mdi:currency-eur"},{"property":"entity_category","value":""},{"property":"device_class","value":""},{"property":"unit_of_measurement","value":"EUR/kWh"},{"property":"state_class","value":""}],"resend":true,"debugEnabled":false},{"id":"887f061916c54562","type":"ha-entity-config","server":"1101e9cb.075866","deviceConfig":"","name":"sensor config for Price in 1 hour","version":"6","entityType":"sensor","haConfig":[{"property":"name","value":"Price +1 hour"},{"property":"icon","value":"mdi:currency-eur"},{"property":"entity_category","value":""},{"property":"device_class","value":""},{"property":"unit_of_measurement","value":"EUR/kWh"},{"property":"state_class","value":""}],"resend":true,"debugEnabled":false},{"id":"375aa345a1202971","type":"ha-entity-config","server":"1101e9cb.075866","deviceConfig":"","name":"sensor config for Price in 2 hours","version":"6","entityType":"sensor","haConfig":[{"property":"name","value":"Price +2 hours"},{"property":"icon","value":"mdi:currency-eur"},{"property":"entity_category","value":""},{"property":"device_class","value":""},{"property":"unit_of_measurement","value":"EUR/kWh"},{"property":"state_class","value":""}],"resend":true,"debugEnabled":false},{"id":"eb0d4cb5d9d5e7bd","type":"ha-entity-config","server":"1101e9cb.075866","deviceConfig":"","name":"sensor config for Price in 3 hours","version":"6","entityType":"sensor","haConfig":[{"property":"name","value":"Price +3 hours"},{"property":"icon","value":"mdi:currency-eur"},{"property":"entity_category","value":""},{"property":"device_class","value":""},{"property":"unit_of_measurement","value":"EUR/kWh"},{"property":"state_class","value":""}],"resend":true,"debugEnabled":false},{"id":"e1956e8443b7732b","type":"ha-entity-config","server":"1101e9cb.075866","deviceConfig":"","name":"sensor config for Price in 4 hours","version":"6","entityType":"sensor","haConfig":[{"property":"name","value":"Price +4 hours"},{"property":"icon","value":"mdi:currency-eur"},{"property":"entity_category","value":""},{"property":"device_class","value":""},{"property":"unit_of_measurement","value":"EUR/kWh"},{"property":"state_class","value":""}],"resend":true,"debugEnabled":false},{"id":"cb2721b09234eda7","type":"ha-entity-config","server":"1101e9cb.075866","deviceConfig":"","name":"sensor config for Price in 5 hours","version":"6","entityType":"sensor","haConfig":[{"property":"name","value":"Price +5 hours"},{"property":"icon","value":"mdi:currency-eur"},{"property":"entity_category","value":""},{"property":"device_class","value":""},{"property":"unit_of_measurement","value":"EUR/kWh"},{"property":"state_class","value":""}],"resend":true,"debugEnabled":false},{"id":"10d5cb062d73c8b2","type":"ha-entity-config","server":"1101e9cb.075866","deviceConfig":"","name":"sensor config for Price in 6 hours","version":"6","entityType":"sensor","haConfig":[{"property":"name","value":"Price +6 hours"},{"property":"icon","value":"mdi:currency-eur"},{"property":"entity_category","value":""},{"property":"device_class","value":""},{"property":"unit_of_measurement","value":"EUR/kWh"},{"property":"state_class","value":""}],"resend":true,"debugEnabled":false},{"id":"d789d71f44158785","type":"ha-entity-config","server":"1101e9cb.075866","deviceConfig":"","name":"binary sensor config for runApplianceLow","version":6,"entityType":"binary_sensor","haConfig":[{"property":"name","value":"runApplianceLow"},{"property":"device_class","value":""},{"property":"icon","value":""},{"property":"unit_of_measurement","value":""},{"property":"state_class","value":""},{"property":"last_reset","value":""}],"resend":true},{"id":"8f4fb67ec1f422eb","type":"ha-entity-config","server":"1101e9cb.075866","deviceConfig":"","name":"binary sensor config for runApplianceHigh","version":"6","entityType":"binary_sensor","haConfig":[{"property":"name","value":"runApplianceHigh"},{"property":"icon","value":""},{"property":"entity_category","value":""},{"property":"device_class","value":""}],"resend":true,"debugEnabled":false},{"id":"28d307ed2064f1d6","type":"ha-entity-config","server":"1101e9cb.075866","deviceConfig":"","name":"Treshold Price Low","version":"6","entityType":"sensor","haConfig":[{"property":"name","value":"Treshold Price Low"},{"property":"icon","value":"mdi:currency-eur"},{"property":"entity_category","value":""},{"property":"device_class","value":""},{"property":"unit_of_measurement","value":"EUR/kWh"},{"property":"state_class","value":""}],"resend":true,"debugEnabled":false},{"id":"8786856ed61503df","type":"ha-entity-config","server":"1101e9cb.075866","deviceConfig":"","name":"Threshold Price High","version":"6","entityType":"sensor","haConfig":[{"property":"name","value":"Threshold Price High"},{"property":"icon","value":"mdi:currency-eur"},{"property":"entity_category","value":""},{"property":"device_class","value":""},{"property":"unit_of_measurement","value":"EUR/kWh"},{"property":"state_class","value":""}],"resend":true,"debugEnabled":false},{"id":"f45a19086955235f","type":"ha-entity-config","server":"1101e9cb.075866","deviceConfig":"","name":"Threshold Price Low Tomorrow","version":"6","entityType":"sensor","haConfig":[{"property":"name","value":"Threshold Price Low Tomorrow"},{"property":"icon","value":"mdi:currency-eur"},{"property":"entity_category","value":""},{"property":"device_class","value":""},{"property":"unit_of_measurement","value":"EUR/kWh"},{"property":"state_class","value":""}],"resend":true,"debugEnabled":false},{"id":"c2c4ce1a4eeb4bac","type":"ha-entity-config","server":"1101e9cb.075866","deviceConfig":"","name":"Threshold Price High Tomorrow","version":"6","entityType":"sensor","haConfig":[{"property":"name","value":"Threshold Price High Tomorrow"},{"property":"icon","value":"mdi:currency-eur"},{"property":"entity_category","value":""},{"property":"device_class","value":""},{"property":"unit_of_measurement","value":"EUR/kWh"},{"property":"state_class","value":""}],"resend":true,"debugEnabled":false},{"id":"1d4fcf6095bc6e5b","type":"ha-entity-config","server":"1101e9cb.075866","deviceConfig":"","name":"sensor config for Price tomorrow","version":"6","entityType":"sensor","haConfig":[{"property":"name","value":"Price tomorrow"},{"property":"icon","value":"mdi:currency-eur"},{"property":"entity_category","value":""},{"property":"device_class","value":""},{"property":"unit_of_measurement","value":"EUR/kWh"},{"property":"state_class","value":""}],"resend":true,"debugEnabled":false},{"id":"8b65be0177b2c72d","type":"ha-entity-config","server":"1101e9cb.075866","deviceConfig":"","name":"Run on lowest price","version":"6","entityType":"binary_sensor","haConfig":[{"property":"name","value":"Run appliance on lowest price"},{"property":"icon","value":""},{"property":"entity_category","value":""},{"property":"device_class","value":""}],"resend":true,"debugEnabled":false},{"id":"1101e9cb.075866","type":"server","name":"Home Assistant","version":5,"addon":true,"rejectUnauthorizedCerts":true,"ha_boolean":"y|yes|true|on|home|open","connectionDelay":true,"cacheJson":true,"heartbeat":false,"heartbeatInterval":"30","areaSelector":"friendlyName","deviceSelector":"friendlyName","entitySelector":"friendlyName","statusSeparator":"at: ","statusYear":"hidden","statusMonth":"short","statusDay":"numeric","statusHourCycle":"h23","statusTimeFormat":"h:m","enableGlobalContextStore":true}]