Vinnerliste
Populært innhold
Viser innholdet med mest poeng fra 25. nov. 2024 i alle områder
-
Har hatt et litt for komplisert program for å finne de laveste strømpristimene (etter litt for mange strømprisleverandører som dukker opp for så å forsvinne igjen...) så nå har jeg skrevet om og koden er blitt delelig med andre... Det kan fremdeles se litt komplisert ut men flyten er stort sett ovenfra og ned men om en gjør endringer i f.eks. timevalg må en gå litt tilbake og oppdatere uten å lage en endeløs loop. Funksjonen er rimelig enkel: Strømpriser hentes fra hvakosterstrommen.no (med manuelt alternativ fra NordPool) kl 13:02 og gjentas hvert 5. minutt inntil strømdata er mottatt. En kan velge et antall billige timer en trenger (2 alternativer) og er en innenfor de valgte timer slås der på globale variabler: lavPris og lavLavPris som kan benyttes fritt til å styre f.eks bereder. Systemet forholder seg kun til totalpris inkl avgifter og strømstøtte siden det er den vi virkelig betaler men de andre prisene vises også for informasjon. Systemet lagrer strømpriser for 72 timer og har en "Planleggingsperiode" fra kl 22:00 til 22:00. Denne perioden er valgt siden nettleien faller kl 22:00 i ukedagene og det kan være greit å få med seg. Det hele vises grafisk på en rimelig oversiktlig måte (mener jeg...). Om/Når nettleien endrer seg må det endres i noden "Lagre nettleie" og aktiviseres med trykk på "timestamp". Pr i dag ligger nettleie inne med 0.7 og 0.6 for hhv dag og natt/helg. Flowen ser slik ut: Skjermbilde med betjening (i dette bildet er med noen få tilleggselementer som er viktig i mitt system men som ikke har noe med strømpris å gjøre): Ant lave timer og Ant LavLav timer er valg for hvor mange timer en vil ha. Listboksene under viser de utvalgte timene inkl strømpris for hver time. Over listboksene vises status: Om en er innenfor eller utenfor de valgte timene. De utvalgte timene vises i grafen som lilla. "Vis kun resttimer" er et valg for å fjerne timer som er "brukt" fra listboksene. Dette er kun et visuelt valg og påvirker ikke annen funksjon. Graf Blå er planleggingsperioden og også markert inneværende time. Graf Oransje er total strømpris som vi betaler og resten i grafen sier seg selv med etikettene øverst. Visning av "Vis kun resttimer" og overgang til ny planperiode: Visning av når nye prisdata ankommer kl 13:02: [{"id":"8a9326e69a043d08","type":"delay","z":"b468e89a030cb946","name":"","pauseType":"delay","timeout":"1","timeoutUnits":"seconds","rate":"1","nbRateUnits":"1","rateUnits":"minute","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":true,"allowrate":false,"outputs":1,"x":1040,"y":840,"wires":[["143924fdaab67cff","cb7159478bedaaf1"]]},{"id":"178c4f3e51c168f5","type":"function","z":"b468e89a030cb946","name":"Refresh Dashboard items","func":"var m1 = {reset:true};\nreturn [[m1,msg]];","outputs":1,"timeout":"","noerr":0,"initialize":"","finalize":"","libs":[],"x":850,"y":840,"wires":[["8a9326e69a043d08"]]},{"id":"19314273e31cb034","type":"group","z":"b468e89a030cb946","name":"Strømpris chart","style":{"fill":"#e3f3d3","label":true,"color":"#000000"},"nodes":["d45591226bb68efc","1366923163fe3133","cb7159478bedaaf1","08a9ac90d5a7da54"],"x":14,"y":549,"w":752,"h":122},{"id":"d45591226bb68efc","type":"ui_chart","z":"b468e89a030cb946","g":"19314273e31cb034","name":"","group":"a51799506567a0f3","order":2,"width":"0","height":"0","label":"Strømplan 24/72 timer.","chartType":"line","legend":"true","xformat":"dd HH","interpolate":"step","nodata":"wait","dot":false,"ymin":"","ymax":"","removeOlder":"48","removeOlderPoints":"100","removeOlderUnit":"3600","cutout":0,"useOneColor":true,"useUTC":false,"colors":["#ff7f0e","#62a0ea","#edd400","#f7f7f7","#98df8a","#62a0ea","#813d9c","#9467bd","#c5b0d5"],"outputs":1,"useDifferentColor":false,"className":"","x":640,"y":590,"wires":[["b6089f059556a469","45a6be97437e5578","143924fdaab67cff"]]},{"id":"1366923163fe3133","type":"inject","z":"b468e89a030cb946","g":"19314273e31cb034","name":"","props":[{"p":"payload"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"[]","payloadType":"json","x":590,"y":630,"wires":[["d45591226bb68efc"]]},{"id":"cb7159478bedaaf1","type":"function","z":"b468e89a030cb946","g":"19314273e31cb034","name":"Prepare for 72h chart","func":"let markPlanPer = flow.get(\"prisMax\") + 0.2 || 1.5; // Høyde på markør for planperiode og inneværende time\nlet markSelHours = markPlanPer * 0.08; // Høyde på markør for planperiode og inneværende time\nlet markCurrentHour = markPlanPer * 0.98;\n\nlet prisMax = -99;\nlet prisMin = 99;\nlet prisSnitt = 0;\nlet dt = new Date();\n//Ny periode kl 22:00: Flytt dato til over midnatt for å sette periodestart og slutt.\nif (dt.getHours() >= 22) dt = new Date(Number(dt) + 4*60*60*1000);\n\nlet dt2 = Number(new Date(dt.getFullYear() + \".\" + (dt.getMonth()+1) + \".\" + dt.getDate() + \" 00:00\"));\nlet dtPerStart = dt2 - 2*60*60*1000;\nlet dtPerEnd = dt2 + 22*60*60*1000;\n\n//node.warn(dtPerStart);\n//node.warn(dtPerEnd);\n\n// Resett dt til riktig tid.\ndt = new Date();\n\n\ndt.setDate(dt.getDate());\nlet currHour = dt.getHours();\nlet currDate = dt.getDate();\nlet currMonth = dt.getMonth() + 1; // Mnd er 0-11 i utgangspunktet\nlet currYear = dt.getFullYear();\nlet currPlanPerStart = new Date()\n\nlet timerValgtLav = []\ntimerValgtLav = flow.get(\"timerValgtLav\");\nlet timerValgtLavLav = []\ntimerValgtLavLav = flow.get(\"timerValgtLavLav\");\n\nlet pdt=0; //PrisDenneTime for kalkulasjoner\nlet msg2 = [[],[],[],[]];\nmsg2.payload = [{ \"series\": [\"Jonaspris\", \"\", \"Råpris+nettleie og avgifter\",\"Råpris\",\"Nettleie\",\"\",\"Lave priser\",\"LavLave priser\"], \"data\": [[],[],[],[],[],[],[],[]], \"labels\": []}];\nlet pris72 = flow.get(\"Prisdata72\");\nlet i = 0;\n\nif (pris72 != null) {\n for (i = 0; i < pris72.length; i++){\n pdt = Number(pris72[i].pris);\n var priceHourTimestamp = new Date(pris72[i].ts);//new Date(pris48[i].timestamp);\n msg2.payload[0].data[0][i] = {\"x\": Number(priceHourTimestamp), \"y\": Number(pris72[i].jonaspris).toFixed(2)};\n msg2.payload[0].data[2][i] = {\"x\": Number(priceHourTimestamp), \"y\": Number(pris72[i].pristot).toFixed(2)};\n msg2.payload[0].data[3][i] = {\"x\": Number(priceHourTimestamp), \"y\": Number(pris72[i].pris).toFixed(2)};\n msg2.payload[0].data[4][i] = {\"x\": Number(priceHourTimestamp), \"y\": Number(pris72[i].nettleie).toFixed(2)};\n\n // Add \"Now\" marker\n if (Number(currDate) === Number(priceHourTimestamp.getDate() ) && Number(currHour) === Number(priceHourTimestamp.getHours())){\n msg2.payload[0].data[1][i] = {\"x\": Number(priceHourTimestamp), \"y\": markCurrentHour};}\n else{\n msg2.payload[0].data[1][i] = {\"x\": Number(priceHourTimestamp), \"y\": 0};}\n \n // Add \"Planning period\" marker\n if (pris72[i].ts >= dtPerStart && pris72[i].ts < dtPerEnd){\n msg2.payload[0].data[5][i] = {\"x\": Number(priceHourTimestamp) + 1, \"y\": markPlanPer};\n // Finn max, min og gjennomsnittspris\n if (Number(pris72[i].jonaspris) < prisMin) prisMin = Number(pris72[i].jonaspris);\n if (Number(pris72[i].jonaspris) > prisMax) prisMax = Number(pris72[i].jonaspris);\n prisSnitt += Number(pris72[i].jonaspris);\n //node.warn(i);\n }\n else{\n msg2.payload[0].data[5][i] = {\"x\": Number(priceHourTimestamp) + 2, \"y\": 0};\n }\n\n // Add \"Selected low hours\" marker\n let phts = Number(new Date(priceHourTimestamp));\n// let phtsFormatted = phts.getFullYear() + \"-\" + (\"00\" + (phts.getMonth() + 1)).slice(-2) + \"-\" + (\"00\" + phts.getDate()).slice(-2) + \" \" + (\"00\" + phts.getHours()).slice(-2) + \":\" + (\"00\" + phts.getMinutes()).slice(-2);\n// let exists = timerValgtLav.some(c => c.timestamp === phtsFormatted); //\"2024-11-06 02:00\");\n let exists = timerValgtLav.some(c => c.ts === phts); //\"2024-11-06 02:00\");\n if (exists){\n // node.warn(\"På\");\n msg2.payload[0].data[6][i] = {\"x\": Number(priceHourTimestamp), \"y\": markSelHours};}\n else{\n // node.warn(\"Av\");\n msg2.payload[0].data[6][i] = {\"x\": Number(priceHourTimestamp), \"y\": 0};\n }\n\n // Add \"Selected LowLow hours\" marker\n phts = Number(new Date(priceHourTimestamp));\n// phtsFormatted = phts.getFullYear() + \"-\" + (\"00\" + (phts.getMonth() + 1)).slice(-2) + \"-\" + (\"00\" + phts.getDate()).slice(-2) + \" \" + (\"00\" + phts.getHours()).slice(-2) + \":\" + (\"00\" + phts.getMinutes()).slice(-2);\n exists = timerValgtLavLav.some(c => c.ts === phts); //\"2024-11-06 02:00\");\n// exists = timerValgtLavLav.some(c => c.timestamp === phtsFormatted); //\"2024-11-06 02:00\");\n //node.warn(exists);\n if (exists){\n // node.warn(\"På\");\n msg2.payload[0].data[7][i] = {\"x\": Number(priceHourTimestamp), \"y\": markSelHours*.6};}\n else{\n // node.warn(\"Av\");\n msg2.payload[0].data[7][i] = {\"x\": Number(priceHourTimestamp), \"y\": 0};\n }\n \n\n }\n // Legg til time # 73 for bedre lesbarhet\n priceHourTimestamp = Number(priceHourTimestamp) + (1000 * 60 * 60)\n //node.warn(Number(priceHourTimestamp));\n msg2.payload[0].data[0][i] = { \"x\": Number(priceHourTimestamp), \"y\": Number(pris72[i-1].jonaspris).toFixed(2)};\n msg2.payload[0].data[1][i] = { \"x\": Number(priceHourTimestamp), \"y\": 0};\n msg2.payload[0].data[2][i] = { \"x\": Number(priceHourTimestamp), \"y\": Number(pris72[i-1].pristot).toFixed(2)};\n msg2.payload[0].data[3][i] = { \"x\": Number(priceHourTimestamp), \"y\": Number(pris72[i-1].pris).toFixed(2)};\n msg2.payload[0].data[4][i] = { \"x\": Number(priceHourTimestamp), \"y\": Number(pris72[i-1].nettleie).toFixed(2)};\n msg2.payload[0].data[5][i] = { \"x\": Number(priceHourTimestamp), \"y\": 0 };\n msg2.payload[0].data[6][i] = { \"x\": Number(priceHourTimestamp), \"y\": 0 };\n msg2.payload[0].data[7][i] = { \"x\": Number(priceHourTimestamp), \"y\": 0 };\n}\n\nprisSnitt = prisSnitt/24;\nflow.set(\"prisMin\", prisMin);\nflow.set(\"prisMax\", prisMax);\nflow.set(\"prisSnitt\", prisSnitt);\n\n// Fjern unødvendige/gamle data fra chart\nlet msg3 = [[],[]]\nmsg3.payload = msg2.payload;\nfor (i = 0; i < 20; i++){\n for (let j = 0; j<=7;j++){\n msg3.payload[0].data[j].shift();\n }\n}\n\n//node.warn(msg3.payload);\n\nmsg.payload = msg3.payload;\nreturn msg;","outputs":1,"timeout":"","noerr":0,"initialize":"","finalize":"","libs":[],"x":360,"y":590,"wires":[["d45591226bb68efc"]]},{"id":"08a9ac90d5a7da54","type":"inject","z":"b468e89a030cb946","g":"19314273e31cb034","name":"Refresh charts","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"0 0-23 * * *","once":true,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":140,"y":590,"wires":[["cb7159478bedaaf1"]]},{"id":"a51799506567a0f3","type":"ui_group","name":"Charts","tab":"a73dc047b0befb9e","order":3,"disp":false,"width":"30","collapse":false,"className":""},{"id":"a73dc047b0befb9e","type":"ui_tab","name":"Prisgraf v2","icon":"euro_symbol","order":7,"disabled":false,"hidden":false},{"id":"bb1f6387ef45151f","type":"group","z":"b468e89a030cb946","name":"Tabell laveste timer for batterilading","style":{"fill":"#e3f3d3","label":true,"color":"#000000"},"nodes":["3ea6f148d6030a9f","45a6be97437e5578","f944761036305ed5","7cc2fd4a050bccdd","3f26c24b2f14e081","60c75de6263a8794","50456aa1e7ddea01"],"x":14,"y":679,"w":1042,"h":142},{"id":"3ea6f148d6030a9f","type":"ui_table","z":"b468e89a030cb946","g":"bb1f6387ef45151f","group":"e9e1f6f856a0ef75","name":"Laveste LavLav priser tbl","order":9,"width":"5","height":"10","columns":[{"field":"timestamp","title":"Time","width":"65%","align":"left","formatter":"plaintext","formatterParams":{"target":"_blank"}},{"field":"jonaspris","title":"Pris","width":"28%","align":"right","formatter":"plaintext","formatterParams":{"target":"_blank"}}],"outputs":0,"cts":false,"x":920,"y":780,"wires":[]},{"id":"45a6be97437e5578","type":"function","z":"b468e89a030cb946","g":"bb1f6387ef45151f","name":"Hent valgte pristimer","func":"let liste2 = flow.get(\"liste2\") || false // Vis kun resttimer i listbox Lav og LavLav\nlet pdLow = flow.get(\"lavpris\");\nlet nmax = flow.get(\"AntLavLavTimer\");\nlet pdSelected = []\nlet pdSelDisp = []\nlet i = 0;\n// Klon objekt for å bryte forbindelsen til opprinnelige data for ellers vil opprinnelige data endres\nlet newpdLow = RED.util.cloneMessage(pdLow); \nlet dt = new Date();\n\n\nfor (i = 0; i < nmax;i++){\n pdSelected.push(newpdLow[i]);\n}\nflow.set(\"timerValgtLavLav\", pdSelected);\n\n// Fjern foregående timer fra tabell dersom valgt\nfor (i = 0; i < nmax;i++){\n if (liste2){\n if (pdLow[i].ts >= (Number(dt) - 60*60*1000)){\n pdSelDisp.push(newpdLow[i]);\n }\n }else{\n pdSelDisp.push(newpdLow[i]);\n }\n//node.warn(pdLow[i].ts);\n//node.warn(Number(dt));\n\n}\n\n// Pynt dataene for tabellvisning\nfor (i = 0; i < pdSelDisp.length;i++){\n pdSelDisp[i].timestamp = new Date(pdSelDisp[i].ts).toLocaleString(\"nb-NO\").slice(0,-3) ;\n pdSelDisp[i].jonaspris = parseFloat(pdSelDisp[i].jonaspris).toFixed(2);\n}\n//node.warn(pdSelDisp),\nmsg.payload = pdSelDisp;\nreturn msg;","outputs":1,"timeout":0,"noerr":0,"initialize":"","finalize":"","libs":[],"x":430,"y":780,"wires":[["60c75de6263a8794"]]},{"id":"f944761036305ed5","type":"ui_numeric","z":"b468e89a030cb946","g":"bb1f6387ef45151f","name":"","label":"Ant LavLav timer","tooltip":"Velg antall laveste pristimer for batterilading","group":"e9e1f6f856a0ef75","order":5,"width":"5","height":"1","wrap":false,"passthru":false,"topic":"topic","topicType":"msg","format":"{{value}}","min":"0","max":"24","step":1,"className":"","x":330,"y":720,"wires":[["3f26c24b2f14e081"]]},{"id":"7cc2fd4a050bccdd","type":"change","z":"b468e89a030cb946","g":"bb1f6387ef45151f","name":"get LavLav#","rules":[{"t":"set","p":"payload","pt":"msg","to":"AntLavLavTimer","tot":"flow"}],"action":"","property":"","from":"","to":"","reg":false,"x":110,"y":720,"wires":[["f944761036305ed5"]]},{"id":"3f26c24b2f14e081","type":"change","z":"b468e89a030cb946","g":"bb1f6387ef45151f","name":"set LavLav#","rules":[{"t":"set","p":"AntLavLavTimer","pt":"flow","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":520,"y":720,"wires":[["7cc2fd4a050bccdd","45a6be97437e5578","178c4f3e51c168f5"]]},{"id":"60c75de6263a8794","type":"sort","z":"b468e89a030cb946","g":"bb1f6387ef45151f","name":"","order":"ascending","as_num":false,"target":"payload","targetType":"msg","msgKey":"timestamp","msgKeyType":"jsonata","seqKey":"payload","seqKeyType":"msg","x":650,"y":780,"wires":[["3ea6f148d6030a9f"]]},{"id":"50456aa1e7ddea01","type":"inject","z":"b468e89a030cb946","g":"bb1f6387ef45151f","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"300","crontab":"","once":true,"onceDelay":"10","topic":"","payload":"","payloadType":"date","x":150,"y":780,"wires":[["7cc2fd4a050bccdd","4bcea84cb9e1dcd0"]]},{"id":"e9e1f6f856a0ef75","type":"ui_group","name":"Tabeller","tab":"a73dc047b0befb9e","order":2,"disp":false,"width":"10","collapse":false,"className":""},{"id":"a6bf2d9c44840471","type":"group","z":"b468e89a030cb946","name":"Sett global.lavPris & lavLavPris for bruk over alt.","style":{"fill":"#e3f3d3","label":true,"color":"#000000"},"nodes":["c37c0f4b7371feab","143924fdaab67cff","6782814db0d4c03a","f4934fafce556690","d4e405705b11b8ea","32bbe8db8e28a1fb"],"x":14,"y":1009,"w":772,"h":172},{"id":"c37c0f4b7371feab","type":"cronplus","z":"b468e89a030cb946","g":"a6bf2d9c44840471","name":"","outputField":"payload","timeZone":"","storeName":"","commandResponseMsgOutput":"output1","defaultLocation":"","defaultLocationType":"default","outputs":1,"options":[{"name":"schedule1","topic":"topic1","payloadType":"default","payload":"","expressionType":"cron","expression":"0 0 * * * * *","location":"","offset":"0","solarType":"all","solarEvents":"sunrise,sunset"}],"x":120,"y":1080,"wires":[["143924fdaab67cff"]]},{"id":"143924fdaab67cff","type":"function","z":"b468e89a030cb946","g":"a6bf2d9c44840471","name":"Set global.lavPris & global.lavLavPris","func":"let msg2 = {}\nlet msg3 = {}\nlet msg4 = {}\nlet timerValgtLav = []\ntimerValgtLav = flow.get(\"timerValgtLav\");\nlet phts = new Date();\nlet phtsFormatted = phts.getFullYear() + \"-\" + (\"00\" + (phts.getMonth() + 1)).slice(-2) + \"-\" + (\"00\" + phts.getDate()).slice(-2) + \" \" + (\"00\" + phts.getHours()).slice(-2) + \":\" + (\"00\" + phts.getMinutes()).slice(-2);\nphtsFormatted = phtsFormatted.slice(0,-2) + \"00\";\nlet phts2 = Number(new Date(phtsFormatted));\nlet exists = timerValgtLav.some(c => c.ts === Number(phts2)); //\"2024-11-06 02:00\")\n//node.warn(exists);\n\nglobal.set(\"lavPris\", exists);\nif (exists)\n msg.payload = \"<font color=lime>Ok\";\nelse\n msg.payload = \"<font color=red>-----\";\n\n\nlet timerValgtLavLav = []\ntimerValgtLavLav = flow.get(\"timerValgtLavLav\");\nphts = new Date();\nphtsFormatted = phts.getFullYear() + \"-\" + (\"00\" + (phts.getMonth() + 1)).slice(-2) + \"-\" + (\"00\" + phts.getDate()).slice(-2) + \" \" + (\"00\" + phts.getHours()).slice(-2) + \":\" + (\"00\" + phts.getMinutes()).slice(-2);\nphtsFormatted = phtsFormatted.slice(0, -2) + \"00\";\nphts2 = Number(new Date(phtsFormatted));\nexists = timerValgtLavLav.some(c => c.ts === phts2); //\"2024-11-06 02:00\")\n//node.warn(exists);\n\nglobal.set(\"lavLavPris\", exists);\nif (exists)\n msg2.payload = \"<font color=lime>Ok\";\nelse\n msg2.payload = \"<font color=red>-----\";\n\n// Send prisdata til \"Solar\" for bruk i headline\nmsg4.topic = \"prisMin\";\nmsg4.payload = flow.get(\"prisMin\").toFixed(2);\nnode.send([null,null,null,msg4]);\nmsg4.topic = \"prisSnitt\";\nmsg4.payload = flow.get(\"prisSnitt\").toFixed(2);\nnode.send([null, null, null, msg4]);\nmsg4.topic = \"prisMax\";\nmsg4.payload = flow.get(\"prisMax\").toFixed(2);\nnode.send([null, null, null, msg4]);\n\nmsg3.payload = \"<font size=5 color=orange>Min:\" + flow.get(\"prisMin\").toFixed(2) + \"/sn:\" + flow.get(\"prisSnitt\").toFixed(2) + \"/max:\" + flow.get(\"prisMax\").toFixed(2);\nreturn [msg,msg2,msg3];","outputs":4,"timeout":0,"noerr":0,"initialize":"","finalize":"","libs":[],"x":400,"y":1070,"wires":[["6782814db0d4c03a"],["f4934fafce556690"],["d4e405705b11b8ea"],["32bbe8db8e28a1fb"]]},{"id":"6782814db0d4c03a","type":"ui_text","z":"b468e89a030cb946","g":"a6bf2d9c44840471","group":"e9e1f6f856a0ef75","order":6,"width":"5","height":"1","name":"Vis Lav nå","label":"","format":"Nå: <font size = 6>{{msg.payload}}","layout":"row-left","className":"","style":false,"font":"","fontSize":16,"color":"#000000","x":670,"y":1050,"wires":[]},{"id":"f4934fafce556690","type":"ui_text","z":"b468e89a030cb946","g":"a6bf2d9c44840471","group":"e9e1f6f856a0ef75","order":7,"width":"5","height":"1","name":"Vis LavLav nå","label":"","format":"Nå: <font size = 6>{{msg.payload}}","layout":"row-left","className":"","style":false,"font":"","fontSize":16,"color":"#000000","x":680,"y":1080,"wires":[]},{"id":"d4e405705b11b8ea","type":"ui_text","z":"b468e89a030cb946","g":"a6bf2d9c44840471","group":"e9e1f6f856a0ef75","order":10,"width":0,"height":0,"name":"MinSnMax","label":"","format":"{{msg.payload}}","layout":"row-center","className":"","style":false,"font":"","fontSize":16,"color":"#000000","x":670,"y":1110,"wires":[]},{"id":"32bbe8db8e28a1fb","type":"link out","z":"b468e89a030cb946","g":"a6bf2d9c44840471","name":"Strompris_Out","mode":"link","links":["c6012e7bbe73f35f"],"x":615,"y":1140,"wires":[]},{"id":"5d782f6a3df9efea","type":"group","z":"b468e89a030cb946","name":"Tabell lave timer for direkte forbruk","style":{"fill":"#e3f3d3","label":true,"color":"#000000"},"nodes":["9486fc1a301c466d","b6089f059556a469","52e50cf1d1089267","4bcea84cb9e1dcd0","031c1a6834f7945d","7bf74d11170a6864"],"x":14,"y":859,"w":1022,"h":142},{"id":"9486fc1a301c466d","type":"ui_table","z":"b468e89a030cb946","g":"5d782f6a3df9efea","group":"e9e1f6f856a0ef75","name":"Laveste Lav priser tbl","order":8,"width":"5","height":"10","columns":[{"field":"timestamp","title":"Time","width":"65%","align":"left","formatter":"plaintext","formatterParams":{"target":"_blank"}},{"field":"jonaspris","title":"Pris","width":"28%","align":"right","formatter":"plaintext","formatterParams":{"target":"_blank"}}],"outputs":0,"cts":false,"x":910,"y":960,"wires":[]},{"id":"b6089f059556a469","type":"function","z":"b468e89a030cb946","g":"5d782f6a3df9efea","name":"Hent valgte pristimer","func":"let liste2 = flow.get(\"liste2\") || false // Vis kun resttimer i listbox Lav og LavLav\nlet pdLow = flow.get(\"lavpris\");\nlet nmax = flow.get(\"AntLavTimer\");\nlet pdSelected = []\nlet pdSelDisp = []\nlet i = 0;\n// Klon objekt for å bryte forbindelsen til opprinnelige data for ellers vil opprinnelige data endres\nlet newpdLow = RED.util.cloneMessage(pdLow);\n\nlet dt = new Date();\n\nfor (i = 0; i < nmax;i++){\n pdSelected.push(newpdLow[i]);\n}\n\nflow.set(\"timerValgtLav\", pdSelected);\n\n\n// Fjern foregående timer fra tabell dersom valgt\nfor (i = 0; i < nmax;i++){\n if (liste2){\n if (pdLow[i].ts >= (Number(dt) - 60*60*1000)){\n pdSelDisp.push(newpdLow[i]);\n }\n }else{\n pdSelDisp.push(newpdLow[i]);\n }\n//node.warn(pdLow[i].ts);\n//node.warn(Number(dt));\n\n}\n\n// Pynt dataene for tabellvisning\nfor (i = 0; i < pdSelDisp.length;i++){\n pdSelDisp[i].timestamp = new Date(pdSelDisp[i].ts).toLocaleString(\"nb-NO\").slice(0,-3) ;\n pdSelDisp[i].jonaspris = parseFloat(pdSelDisp[i].jonaspris).toFixed(2);\n}\n//node.warn(pdSelDisp),\nmsg.payload = pdSelDisp;\nreturn msg;","outputs":1,"timeout":0,"noerr":0,"initialize":"","finalize":"","libs":[],"x":430,"y":960,"wires":[["7bf74d11170a6864"]]},{"id":"52e50cf1d1089267","type":"ui_numeric","z":"b468e89a030cb946","g":"5d782f6a3df9efea","name":"","label":"Ant lave timer","tooltip":"Velg antall lavpristimer for direkte forbruk","group":"e9e1f6f856a0ef75","order":4,"width":"5","height":"1","wrap":false,"passthru":false,"topic":"topic","topicType":"msg","format":"{{value}}","min":"0","max":"24","step":1,"className":"","x":320,"y":900,"wires":[["031c1a6834f7945d"]]},{"id":"4bcea84cb9e1dcd0","type":"change","z":"b468e89a030cb946","g":"5d782f6a3df9efea","name":"get Lav#","rules":[{"t":"set","p":"payload","pt":"msg","to":"AntLavTimer","tot":"flow"}],"action":"","property":"","from":"","to":"","reg":false,"x":100,"y":900,"wires":[["52e50cf1d1089267"]]},{"id":"031c1a6834f7945d","type":"change","z":"b468e89a030cb946","g":"5d782f6a3df9efea","name":"set Lav#","rules":[{"t":"set","p":"AntLavTimer","pt":"flow","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":510,"y":900,"wires":[["4bcea84cb9e1dcd0","b6089f059556a469","178c4f3e51c168f5"]]},{"id":"7bf74d11170a6864","type":"sort","z":"b468e89a030cb946","g":"5d782f6a3df9efea","name":"","order":"ascending","as_num":false,"target":"payload","targetType":"msg","msgKey":"timestamp","msgKeyType":"jsonata","seqKey":"payload","seqKeyType":"msg","x":650,"y":960,"wires":[["9486fc1a301c466d"]]},{"id":"f3eadd1725385808","type":"group","z":"b468e89a030cb946","name":"Innhenting og behandling av strømpriser.","style":{"label":true,"color":"#000000"},"nodes":["bed0051986a10b75","a14d52fac2cf7941","4ce0f27b155c6831","eecf1a11e64a8746"],"x":8,"y":13,"w":1058,"h":504},{"id":"bed0051986a10b75","type":"group","z":"b468e89a030cb946","g":"f3eadd1725385808","name":"Sorter priser etter laveste pris i tidsrommet kl 22:00-22:00","style":{"fill":"#e3f3d3","label":true,"color":"#000000"},"nodes":["f4c0539b6cc55b55","0a56154a01aa97c9","eda587539ada5352","36db9c6b1167cf77"],"x":514,"y":209,"w":392,"h":142},{"id":"f4c0539b6cc55b55","type":"inject","z":"b468e89a030cb946","g":"bed0051986a10b75","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"00 22 * * *","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":630,"y":250,"wires":[["0a56154a01aa97c9"]]},{"id":"0a56154a01aa97c9","type":"function","z":"b468e89a030cb946","g":"bed0051986a10b75","name":"Velg tidsperiode","func":"//flow.set(\"Prisdata48Work\", flow.get(\"Prisdata48\"));\nlet pd72 = flow.get(\"Prisdata72\") || []\nlet lowprice = []\nlet i = 0;\nlet pdDate = Number(new Date(pd72[22].ts));\nlet today = Number(new Date());\n//today += 6 * 60 * 60 * 1000;\n//node.warn(pdDate - today);\nlet dt = new Date();\n//Ny periode kl 22:00: Flytt dato til over midnatt for å sette periodestart og slutt.\nif (dt.getHours() >= 22) dt = new Date(Number(dt) + 4*60*60*1000);\nlet dt2 = Number(new Date(dt.getFullYear() + \".\" + (dt.getMonth()+1) + \".\" + dt.getDate() + \" 00:00\"));\n//node.warn(dt2);\n\n\nlet dt3 = new Date();\n\n//node.warn(dt3.getHours());\nif (pd72.length == 72) { // Enkel sjekk at fullt datasett er tilgjengelig\n if (dt3.getHours() < 22){\n for (i = 22; i <= 45; i++){ // Plukk ut aktuell tidsperiode\n //node.warn(pd72[i]);\n lowprice.push(pd72[i]);\n }\n }\n else{\n for (i = 46; i < 70; i++){ // Plukk ut aktuell tidsperiode fra kl 22:00 og utover til i morgen\n lowprice.push(pd72[i]);\n //node.warn(pd72[i]);\n }\n }\n \n}\nmsg.payload = lowprice;\nreturn msg; \n","outputs":1,"timeout":0,"noerr":0,"initialize":"","finalize":"","libs":[],"x":800,"y":270,"wires":[["eda587539ada5352"]]},{"id":"eda587539ada5352","type":"sort","z":"b468e89a030cb946","g":"bed0051986a10b75","name":"","order":"ascending","as_num":true,"target":"payload","targetType":"msg","msgKey":"jonaspris","msgKeyType":"jsonata","seqKey":"payload","seqKeyType":"msg","x":640,"y":310,"wires":[["36db9c6b1167cf77"]]},{"id":"36db9c6b1167cf77","type":"change","z":"b468e89a030cb946","g":"bed0051986a10b75","name":"","rules":[{"t":"set","p":"lavpris","pt":"flow","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":800,"y":310,"wires":[["cb7159478bedaaf1"]]},{"id":"a14d52fac2cf7941","type":"group","z":"b468e89a030cb946","g":"f3eadd1725385808","name":"Nettleie inkl alle avgifter dag: nld, natt og helg: nlnh. Endres manuelt her ved behov.","style":{"fill":"#92d04f","label":true,"color":"#000000"},"nodes":["d915fc95bcdb617b","599d5c07932ddd54"],"x":514,"y":39,"w":526,"h":82},{"id":"d915fc95bcdb617b","type":"change","z":"b468e89a030cb946","g":"a14d52fac2cf7941","name":"Lagre nettleie","rules":[{"t":"set","p":"nld","pt":"flow","to":".7","tot":"num"},{"t":"set","p":"nlnh","pt":"flow","to":".6","tot":"num"}],"action":"","property":"","from":"","to":"","reg":false,"x":790,"y":80,"wires":[[]]},{"id":"599d5c07932ddd54","type":"inject","z":"b468e89a030cb946","g":"a14d52fac2cf7941","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":620,"y":80,"wires":[["d915fc95bcdb617b"]]},{"id":"4ce0f27b155c6831","type":"group","z":"b468e89a030cb946","g":"f3eadd1725385808","name":"Opprett flow.Prisdata72","style":{"fill":"#c8e7a7","label":true,"color":"#000000"},"nodes":["d51b8abd1f8b0102","06b3fdadafe92af4","20507782eea7238f","d68c7c64b4396e88","68dedc7c5f6d81bd","ba37809882e5a246","845af2cac241faae","7a2d84c871bfca40","7ad93125a55d7c60"],"x":34,"y":39,"w":462,"h":312},{"id":"289686ae32e9ac0c","type":"subflow","name":"Konv til eget format m nettleie og sst","info":"","category":"","in":[{"x":60,"y":70,"wires":[{"id":"4ab1c86d5f9c7f0a"}]}],"out":[{"x":640,"y":70,"wires":[{"id":"4ab1c86d5f9c7f0a","port":0}]}],"env":[],"meta":{},"color":"#DDAA99"},{"id":"4ab1c86d5f9c7f0a","type":"function","z":"289686ae32e9ac0c","name":"Konverter til kompakt format med nettleie o.l.","func":"/* Plukker kun ut råpris (Kr/kWh uten avgifter) og starttidspunkt fra inndata og legger på \nnettleie og avgifter her. Resultatet blir:\n.ts Timestamp (millisekund siden 01.01.1970) hentet fra starttidspunkt for strømprisen\n.pris Råpris uten avgifter o.l.\n.pristot Strømpris inkl avgifter og nettleie\n.jonaspris Strømpris inkl avgifter og nettleie minus strømstøtte\n.nettleie\n\[email protected]\n*/\nlet ny = []\nlet msg2 = {}\nlet nld = flow.get(\"$parent.nld\") || 0.7\nlet nlnh = flow.get(\"$parent.nlnh\") || 0.6\nlet pristot = 0;\nlet nl = 0;\n\nfor (var i = 0; i < msg.payload.length; i++ ){\n // Legg til Jonaspris (strømpris + nettleie + forbruksavgift + Enovastøtte med verdier fra flow)\n let dato = new Date(msg.payload[i].time_start);\n let ukedag = (dato.getDay()+6)%7; // Endre ukedag fra søndag=0 til mandag = 0\n let time = dato.getHours();\n let raapris = msg.payload[i].NOK_per_kWh;\n let jonaspris = raapris;\n if (raapris > 0.73) jonaspris = 0.73 + (raapris - 0.73) * 0.1; // Beregn strømstøtte\n \n // Beregn nettleie\n if (ukedag >= 5 || time < 6 || time >= 22){\n pristot = raapris * 1.25 + nlnh;\n jonaspris = jonaspris * 1.25 + nlnh;\n nl = nlnh;\n }\n else {\n pristot = raapris * 1.25 + nld;\n jonaspris = jonaspris * 1.25 + nld;\n nl = nld;\n } \n let ts = Number(new Date(msg.payload[i].time_start));\n ny.push({ \"ts\": ts, \"pris\": msg.payload[i].NOK_per_kWh, \"pristot\": pristot, \"jonaspris\": jonaspris, \"nettleie\": nl });\n}\nmsg2.payload = ny;\nreturn msg2;","outputs":1,"timeout":0,"noerr":0,"initialize":"","finalize":"","libs":[],"x":300,"y":70,"wires":[[]]},{"id":"d51b8abd1f8b0102","type":"http request","z":"b468e89a030cb946","g":"4ce0f27b155c6831","name":"Prisdata fra hvakosterstrømmen.no","method":"GET","ret":"obj","paytoqs":"ignore","url":"","tls":"","persist":false,"proxy":"","insecureHTTPParser":false,"authType":"","senderr":false,"headers":[],"x":220,"y":190,"wires":[["d68c7c64b4396e88"]]},{"id":"06b3fdadafe92af4","type":"function","z":"b468e89a030cb946","g":"4ce0f27b155c6831","name":"set url i morgen","func":"var msg2 = {};\n\nvar d2 = new Date();\nd2.setDate(d2.getDate() + 1);\nvar nextYear = d2.getFullYear();\nvar nextMonth = (\"00\" + (d2.getMonth() + 1)).slice(-2);\nvar nextDate = (\"00\" + d2.getDate()).slice(-2);\nvar url2 = \"https://www.hvakosterstrommen.no/api/v1/prices/\" + nextYear + \"/\" + nextMonth + \"-\" + nextDate + \"_NO2.json\";\n//var url2 = \"https://www.hvakosterstrommen.no/api/v1/prices/\" + nextYear + \"/\" + nextMonth + \"-\" + \"07\" + \"_NO2.json\";\n//node.warn(nextYear + \" \" + nextMonth + \" \" + nextDate);\nmsg2.url = url2;\n//console.log(url);\n//console.log(url2);\n\nreturn msg2;","outputs":1,"timeout":"","noerr":0,"initialize":"","finalize":"","libs":[],"x":160,"y":150,"wires":[["d51b8abd1f8b0102","7ad93125a55d7c60"]]},{"id":"20507782eea7238f","type":"function","z":"b468e89a030cb946","g":"4ce0f27b155c6831","name":"Fyll inn pris på riktig plass i Prisdata72","func":"let pd72 = flow.get(\"Prisdata72\") || []\nlet dt = new Date();\n// Offset to prev midnight\nlet dt2 = Number(new Date(dt.getFullYear() + \".\" + (dt.getMonth()+1) + \".\" + dt.getDate() + \" 00:00\"));\n\n// Opprett flow.Prisdata72 om den ikke eksisterer\nif (pd72.length < 71){\n for (let i = 0;i < 72;i++) pd72.push([\"-\"]);\n flow.set(\"Prisdata72\", pd72);}\n\n// Sjekk at data er leselige\nif (msg.payload[0].ts != null){\n let msgStartTs = msg.payload[0].ts - dt2;\n // Fyll inn prisdata i riktig tredjedel av Prisdata72\n if (msgStartTs < 0){ // I går ------------------------------------------------\n node.warn(\"<0 Prisdata for i går mottatt\");\n for (let i = 0;i <= 23;i++){\n pd72[i] = msg.payload[i];}}\n if (msgStartTs == 0){ // I dag ------------------------------------------------\n node.warn(\"0 Prisdata for i dag mottatt\");\n for (let i = 0;i <= 23;i++){\n pd72[i+24] = msg.payload[i];}}\n if (msgStartTs > 0){ // I morgen ------------------------------------------------\n node.warn(\">0 Prisdata for i morgen mottatt\");\n // Hvis data 48-71 er for i dag: Skift array 24 plasser tilbake\n if ((pd72[48].ts - dt2) == 0){\n for (let i = 0;i <= 47; i++){\n pd72[i] = pd72[i+24];}\n }\n // ...og så legg inn morgendagens data\n for (let i = 0;i <= 23;i++){\n pd72[i+48] = msg.payload[i];}}\n}else{\n node.warn(\"Strømdata ikke tilgjengelige...\")}\n\n// Marker at prisdata for i morgen er ankommet.\nif ((pd72[48].ts - dt2) == 86400000){\n flow.set(\"pdMorgenOk\", true);}\nelse{\n flow.set(\"pdMorgenOk\", false);}\n\nreturn msg;","outputs":1,"timeout":0,"noerr":0,"initialize":"","finalize":"","libs":[],"x":230,"y":270,"wires":[["0a56154a01aa97c9","68dedc7c5f6d81bd"]]},{"id":"d68c7c64b4396e88","type":"subflow:289686ae32e9ac0c","z":"b468e89a030cb946","g":"4ce0f27b155c6831","name":"","x":230,"y":230,"wires":[["20507782eea7238f"]]},{"id":"68dedc7c5f6d81bd","type":"debug","z":"b468e89a030cb946","g":"4ce0f27b155c6831","name":"debug 187","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":350,"y":310,"wires":[]},{"id":"ba37809882e5a246","type":"inject","z":"b468e89a030cb946","g":"4ce0f27b155c6831","name":"13:02","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"02 13 * * *","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":140,"y":110,"wires":[["06b3fdadafe92af4"]]},{"id":"845af2cac241faae","type":"inject","z":"b468e89a030cb946","g":"4ce0f27b155c6831","name":"hver 5 min","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"*/5 13-21 * * *","once":false,"onceDelay":0.1,"topic":"xx","payload":"","payloadType":"date","x":150,"y":80,"wires":[["7a2d84c871bfca40"]]},{"id":"7a2d84c871bfca40","type":"switch","z":"b468e89a030cb946","g":"4ce0f27b155c6831","name":"Data for i morgen mottatt?","property":"pdMorgenOk","propertyType":"flow","rules":[{"t":"false"}],"checkall":"true","repair":false,"outputs":1,"x":360,"y":80,"wires":[["06b3fdadafe92af4"]]},{"id":"7ad93125a55d7c60","type":"debug","z":"b468e89a030cb946","g":"4ce0f27b155c6831","name":"debug 192","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"url","targetType":"msg","statusVal":"","statusType":"auto","x":350,"y":150,"wires":[]},{"id":"eecf1a11e64a8746","type":"group","z":"b468e89a030cb946","g":"f3eadd1725385808","name":"Prisdata fra NordPool","style":{"fill":"#c8e7a7","label":true,"color":"#000000"},"nodes":["6ce4aa06b498cbbe","62687955c7aa4efe","0b9a6c13ac4210bc","35e0d54c5ac618c8"],"x":34,"y":359,"w":592,"h":132},{"id":"6ce4aa06b498cbbe","type":"nordpool-api-plus","z":"b468e89a030cb946","g":"eecf1a11e64a8746","name":"I morgen","area":"NO2","currency":"NOK","action":"dayAhead","x":140,"y":400,"wires":[["62687955c7aa4efe"]]},{"id":"62687955c7aa4efe","type":"function","z":"b468e89a030cb946","g":"eecf1a11e64a8746","name":"if exist NOK/MWh --> NOK/kWh","func":"let today = new Date()\nlet tomorrow = new Date(today)\ntomorrow.setDate(tomorrow.getDate() + 1)\nlet ddate = new Date(msg.payload[6].timestamp)\n\n// Sjekk at data for i morgen er tilstede\nif (Number(ddate.getDate()) == Number(tomorrow.getDate())){\n for (var i = 0; i < msg.payload.length; i++ ){\n msg.payload[i].NOK_per_kWh = msg.payload[i].price/1000;\n msg.payload[i].time_start = Number(new Date(msg.payload[i].timestamp));\n //node.warn(i);\n }\n return msg;\n}\n","outputs":1,"timeout":0,"noerr":0,"initialize":"","finalize":"","libs":[],"x":430,"y":400,"wires":[["0b9a6c13ac4210bc"]]},{"id":"0b9a6c13ac4210bc","type":"subflow:289686ae32e9ac0c","z":"b468e89a030cb946","g":"eecf1a11e64a8746","x":450,"y":440,"wires":[["20507782eea7238f"]]},{"id":"35e0d54c5ac618c8","type":"inject","z":"b468e89a030cb946","g":"eecf1a11e64a8746","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":140,"y":450,"wires":[["6ce4aa06b498cbbe"]]},{"id":"e4c19e487e8287f7","type":"group","z":"b468e89a030cb946","name":"Betjening: Vis kun resttimer i listbokser.","style":{"fill":"#e3f3d3","label":true,"color":"#000000"},"nodes":["b51d06a21038e464","5ab88c22ad7b601e","a9ad0882e1fb8f2b","1f96c7a359c6fede"],"x":14,"y":1189,"w":572,"h":122},{"id":"b51d06a21038e464","type":"ui_switch","z":"b468e89a030cb946","g":"e4c19e487e8287f7","name":"","label":"Vis kun resttimer","tooltip":"","group":"e9e1f6f856a0ef75","order":15,"width":"3","height":"1","passthru":true,"decouple":"false","topic":"topic","topicType":"msg","style":"","onvalue":"true","onvalueType":"bool","onicon":"check_box","oncolor":"lime","offvalue":"false","offvalueType":"bool","officon":"check_box_outline_blank","offcolor":"grey","animate":true,"className":"","x":320,"y":1270,"wires":[["5ab88c22ad7b601e"]]},{"id":"5ab88c22ad7b601e","type":"change","z":"b468e89a030cb946","g":"e4c19e487e8287f7","name":"flow.liste2","rules":[{"t":"set","p":"liste2","pt":"flow","to":"payload","tot":"msg"},{"t":"delete","p":"socketid","pt":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":500,"y":1270,"wires":[["b6089f059556a469","45a6be97437e5578"]]},{"id":"a9ad0882e1fb8f2b","type":"change","z":"b468e89a030cb946","g":"e4c19e487e8287f7","name":"flow.liste2","rules":[{"t":"set","p":"payload","pt":"msg","to":"liste2","tot":"flow"}],"action":"","property":"","from":"","to":"","reg":false,"x":110,"y":1270,"wires":[["b51d06a21038e464"]]},{"id":"1f96c7a359c6fede","type":"inject","z":"b468e89a030cb946","g":"e4c19e487e8287f7","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"300","crontab":"","once":true,"onceDelay":"5","topic":"","payload":"","payloadType":"date","x":130,"y":1230,"wires":[["a9ad0882e1fb8f2b"]]}] Tror det skal klare seg å installere node-red-dashboard, node-red-contrib-nordpool-api-plus, og node-red-contrib-cron-plus i paletten utover standard.2 poeng
-
Dette er Home Assistant seksjonen for hjemmeautomasjon. Det er en egen seksjon for Nodered: https://www.hjemmeautomasjon.no/forums/forum/102-node-red/1 poeng
-
ser veldig rar ut herfra iaffal. Svarer konsekvent med HTTP/1.1 med en Upgrade: h2 header selv om jeg tvinger på den HTTP/2 request: bjorn@miraculix:~$ curl --http2-prior-knowledge -D - https://www.tronika.no HTTP/1.1 301 Moved Date: Mon, 25 Nov 2024 12:34:59 GMT Server: Apache/2.4.57 (Ubuntu) Cache-Control: no-cache Strict-Transport-Security: max-age=63072000; includeSubdomains; preload Upgrade: h2,h2c Connection: Upgrade Location: https://www.tronika.no/no/ Content-Length: 0 Content-Type: text/html; charset=utf-8 Og når jeg følger den redirecten så får jeg bare 404: bjorn@miraculix:~$ curl --http2-prior-knowledge -D - https://www.tronika.no/no/ HTTP/1.1 404 Not Found Date: Mon, 25 Nov 2024 12:36:32 GMT Server: Apache/2.4.57 (Ubuntu) Set-Cookie: PrestaShop-29ecf8f7503b4bd780ac4d1bb0b03dfa=def502002823f94c1c4ce34ec8f965fb41fb1e0fbdddf8ae12792cc975e3147f31f0c3450514bdc762a9ece2e8f4d4452551acc645e86b576861a07f04938ad9a51e4aa90d80b91425b1e03e937a87af766ea9ff9db7a7b433b947a9f70a4245a264495f93538b572d7c4b1f6c08c1c3ad9f3e1f49f74d7cb9f7a15fa7b0116e2afa2366e9a30f0a097d7771ff9466528ceb0bf669e5622058cc409c85044dd5242aff75ffbfbccae9a980ab0f75e801793687b20e4a0f360c7865066e84a65672395c3f5f0906736a869be6801c06a9b5a14e4537f1a8c0beef39df42a914f1bd1adf6b279acdef5eb1844414360b0c81206ee27125db7183ffc92d8f98c33a70bbbac84bc712e9fb9a5fc2af95c638; expires=Sun, 15-Dec-2024 12:36:32 GMT; Max-Age=1728000; path=/; domain=www.tronika.no; HttpOnly; SameSite=Lax Set-Cookie: PrestaShop-29ecf8f7503b4bd780ac4d1bb0b03dfa=def502002105ce04cc64a12240dd163208a920948998fc42111189d913258a9ff815deb86eafdd6f78f801e0850931681c0a5fdb50694e10ab1b36c8677c7ec9cb150a4cec6e6ff879eea7c641c601e64ea6a74c93cd355eeceb67dac4521fee85414f5c3d074a634d796e123eae7e1c9b44bd23abfb06a5b9ab7a68ff1cf2c88b10a6680cbbb6c21584a731e0161dc51394516fbd3f2cfc2ab9c539d3cc9d603a8f9d4eec9c4f66f5173af0f0929e2d46c2ec49190a3ec8bbc84ad8336329f2b6555b2e46569ab76138341233dcb366a4d035a18a1cb4882a5a8ed28054dec8e6c125850f1f365b6bccaf739fe505eb3e23812a3e2acc29ed95121b56ba3d36d16bcafcf13eb7660b0bc6e76a434b112092cc89f5b748e3b10e92e0ea5ed66cd6ac7dc913e1279baa05e74d26b687da4c36; expires=Sun, 15-Dec-2024 12:36:32 GMT; Max-Age=1728000; path=/; domain=www.tronika.no; HttpOnly; SameSite=Lax Set-Cookie: PrestaShop-6c4bd792258ec4c57a768be2afe766ba=def50200c9340412ea15bb931899f6d14719e8b981529e4defbe9ef1b0a17b82a1f2aed9a4080aa87f7bfc6db8a8e80f09a43352bbbe9e24e7c6f90c11b61f14743c29304ebe9b249eceaa1cf38065fdefcf7c86a15205d47dc2e61a321b6e2fb27d4193f78ebdbb5c80870089f3ee639c59a01cfc2472373191987339f9a3bdffe609861a959b3ccf5a6b89630c04d333336bb607285d3dcffbf28e5295abfa8faf7478eb368e69ed4efba86603102837bd038a08344cd97449013b54de3ab04bf42d086a48ac8556b26dc3969ef37b8100f0baf5143e1f7cc2931baa1b5919a9814e6b3de297e91c6e; expires=Sun, 15-Dec-2024 12:36:32 GMT; Max-Age=1728000; path=/; domain=www.tronika.no; secure; HttpOnly; SameSite=Lax Strict-Transport-Security: max-age=63072000; includeSubdomains; preload Upgrade: h2,h2c Connection: Upgrade Content-Length: 0 Content-Type: text/html; charset=utf-8 enda mer pussig er det at de tydeligvis skulle hadde en annen 404, for om jeg prøver noe som slutter på html så får jeg denne redirecten: bjorn@miraculix:~$ curl --http2-prior-knowledge -D - https://www.tronika.no/no/foo.html HTTP/1.1 302 Found Date: Mon, 25 Nov 2024 12:37:15 GMT Server: Apache/2.4.57 (Ubuntu) Set-Cookie: PrestaShop-6c4bd792258ec4c57a768be2afe766ba=def50200e0666148968f3b8cf76618ae88c2c1aeb0765ee5c9c8affdbf8bb10721d068d5f84820ee7ed007e49224f6609deccb86285a0bef12601fd504ad53c4004dc76909ed69ced0a7859753cbbb3f7cbcef6d8a239427da8f8780188c565dd67200dea52c573f9a17103ea7426f3d20b11d55be8149e612530547e5db697167ffc5c97ef5b94bd20ebf7e1b89ad994e40d7a644eafa9cad97e66bc79b6aa91267424db82aa095d04ade18408596d0311a5aaff253f6dc24d67b94813b94b375abfad16092; expires=Sun, 15-Dec-2024 12:37:15 GMT; Max-Age=1728000; path=/; domain=www.tronika.no; secure; HttpOnly; SameSite=Lax Strict-Transport-Security: max-age=63072000; includeSubdomains; preload Upgrade: h2,h2c Connection: Upgrade Location: https://www.tronika.no/no/fant-ikke-siden Content-Length: 0 Content-Type: text/html; charset=utf-8 som igjen gir en 404. Herlig. Lenger en det gidder normalt ikke jeg før jeg finner meg en annen butikk. Sorry. Enten får de klare å sette opp en fungerende web-tjeneste eller så får de kjøpe det av noen som kan slikt1 poeng
-
@Erling Det ser ut til at 2000watt ovnen i svart bare selges i Nederland og ikke i Norge :/ Fra hva jeg ser så selges Elkjøp bare 1500watt oljeovn i svart farge i Sverige, Elkjøp Norge har bare 1500 watt i hvit.1 poeng
-
@Erling Skal høre med logistikk avdelingen, det er info de sitter på. Skal gi deg et svar på Mandag morgen :)1 poeng
-
Høstens første frost krever alltid litt ekstra arbeid så det er greit å få et varsel noen dager i forkant. Hjul på bil må skiftes, vannslange må innendørs, utekrane må sjekkes at den er tom for vann og campingvogn sine vannbeholdere må tømmes. Så da er et varsel i HA laget slik som dette Det er kun et lett synlig bilde som har en betingelse for synlighet. Først laget jeg en sensor som viser laveste temperatur meldt de nærmeste dagene. - template: - trigger: - trigger: state entity_id: weather.orstad_utsyn action: - action: weather.get_forecasts data: type: daily target: entity_id: weather.orstad_utsyn response_variable: wd sensor: - unique_id: laveste_temperatur_framover name: "Laveste temperatur framover" unit_of_measurement: "°C" state: "{{ [state_attr('weather.orstad_utsyn', 'temperature')|float(0), (wd['weather.orstad_utsyn'].forecast | rejectattr('templow', 'undefined') | map(attribute='templow')|list|min)]|min|round(1) }}" Deretter en binær sensor som bruker laveste temperatur sammen med måned. Jeg trenger ikke varsel om høstens første frost i desember til mai. -template: - binary_sensor: - unique_id: bbb82639-7432-4f3f-8950-a5c860a6ede0 name: frostvarsel state: "{{ states('sensor.laveste_temperatur_framover')|float < 2 and (now().month == 9 or now().month == 10 or now().month == 11) }}" Selve kortet er lagd som dette1 poeng
-
"Feilen" ligger i betingelsene dine: Når sikringen har gått vil garasjelyset aldri kunne bli "OFF". Dermed sørger denne linja: ... for å trigge eventet hvert eneste sekund. "For at least XX" er skummelt å bruke som første betingelse. Bruk heller "for exactly 10 m", så slipper du problemet 🙂 Som en ekstra betingelse går det som oftest utmerket å bruke "for at least". Se FAQ nederst i HS skolen del 7:1 poeng
-
@Venin Det kommer en update til IOS denne uken hvor innloggings problemet 100% løst. En lignende oppdatering kommer til Android neste uke, så da blir det stell på begge appene Det er en utrolig frustrerende feil , så skal ikke si noe på og har vært altfor lenge.0 poeng
Vinnerlisten er satt til Oslo/GMT+01:00