-
Innlegg
1 664 -
Ble med
-
Besøkte siden sist
-
Dager vunnet
98
Innholdstype
Profiler
Forum
Blogger
Nedlastninger
Artikler
Regler
Hendelser
Galleri
Store
Alt skrevet av SveinHa
-
Jeg regner med de meldingene kommer i topic "zigbee2mqtt/BJ_Kontor". Kommer der noe i "zigbee2mqtt/BJ_Kontor/set" når du trykker på knappen på inject noden? Serveren så litt merkelig ut eller har du bare gitt den samme navn som adressen til serveren?
-
Kommer der noe til MQTT broker i det hele tatt? MQTT Explorer er super til å se hva som skjer...
-
Hele greiene ser slik ut: Øverst lagres timeverdier i SQL og lengre nede leses SQL og data presenteres i både chart og table. [{"id":"43c98426301432b6","type":"tibber-data","z":"d49bfe3335c3f7c9","name":"TodaysEnergyPrice","active":true,"apiEndpointRef":"3235237809bb894f","queryName":"getCurrentEnergyPrice","homeId":"4ac606d5-70bb-4b43-9cf8-6f5f867c00a8","energyResolution":"DAILY","lastCount":10,"x":450,"y":1260,"wires":[["06cc550f61d82e1c"]]},{"id":"0b858dc8e357231d","type":"change","z":"d49bfe3335c3f7c9","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"kWh_prev_h","tot":"flow"}],"action":"","property":"","from":"","to":"","reg":false,"x":440,"y":1100,"wires":[["5c11f9028d78108f"]],"info":"{\"a\":$timestamp,\"b\":$flow.kWh_prev_h}"},{"id":"6736cd76640d17bd","type":"cronplus","z":"d49bfe3335c3f7c9","name":"Hourly","outputField":"payload","timeZone":"","persistDynamic":false,"commandResponseMsgOutput":"output1","outputs":1,"options":[{"name":"schedule1","topic":"schedule1","payloadType":"date","payload":"","expressionType":"cron","expression":"0 0 * * * * *","location":"","offset":"0","solarType":"all","solarEvents":"sunrise,sunset"}],"x":50,"y":1100,"wires":[["533368a5de56eede"]]},{"id":"533368a5de56eede","type":"delay","z":"d49bfe3335c3f7c9","name":"","pauseType":"delay","timeout":"3","timeoutUnits":"seconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"allowrate":false,"outputs":1,"x":260,"y":1080,"wires":[["0b858dc8e357231d","6b8d58f5ed2d5568"]]},{"id":"ad8fc9fae833b54e","type":"Stackhero-MySQL","z":"d49bfe3335c3f7c9","server":"c919f77e07994edc","name":"","x":980,"y":1100,"wires":[[]]},{"id":"ec65187082b5f759","type":"function","z":"d49bfe3335c3f7c9","name":"Generate SQL","func":"var kWh_T =flow.get(\"kWh_accT\")|| 0;\nvar MP =flow.get(\"MaxPower\")|| 0;\nvar CP =flow.get(\"CurrentPrice\")|| 0;\nvar PL =flow.get(\"PriceLevel\")|| \"-\";\nvar SP =flow.get(\"PID_SP\")|| 0;\nvar verdi = msg.payload.toFixed(4);\nvar dato = Date.now();\n\nmsg.payload={}\nmsg.payload.dat=dato;\nmsg.payload.verd=verdi;\nmsg.payload.mp=MP;\nmsg.payload.cp=CP;\nmsg.payload.pl=PL;\nmsg.payload.sp=SP;\nmsg.payload.kwht=kWh_T;\n\n\n\nmsg.topic = \"INSERT INTO Energi (kWh_hour, MaxPower, CurrentPrice, kWh_Tibber, PriceLevel, PID_SP) \";\nmsg.topic += \"VALUES ( :verd, :mp, :cp, :kwht, :pl, :sp );\"\n//msg.payload = [dato, verdi];\n//msg.topic += ', ' + verdi\n//msg.topic += ')'\nreturn msg;\n","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":780,"y":1100,"wires":[["ad8fc9fae833b54e"]]},{"id":"5c11f9028d78108f","type":"json","z":"d49bfe3335c3f7c9","name":"","property":"payload","action":"obj","pretty":false,"x":610,"y":1100,"wires":[["ec65187082b5f759"]]},{"id":"1c92d25c775f08c8","type":"comment","z":"d49bfe3335c3f7c9","name":"kWh timeverdi til SQL og .log","info":"","x":160,"y":1040,"wires":[]},{"id":"49ad13fd1b34421d","type":"ui_table","z":"d49bfe3335c3f7c9","group":"188f564c824c87cd","name":"","order":3,"width":"10","height":"12","columns":[],"outputs":0,"cts":false,"x":970,"y":1480,"wires":[]},{"id":"858128e9e731109a","type":"function","z":"d49bfe3335c3f7c9","name":"kWh i dag","func":"var d = new Date();\nd.setDate(d.getDate() - 1);\nvar pd = new Date();\npd.setDate(pd.getDate() - 2);\n\nlet year = d.getFullYear();\nlet month = d.getMonth()+1;\nlet day = d.getDate()+1;\n\nlet pyear = pd.getFullYear();\nlet pmonth = pd.getMonth()+1;\nlet pday = pd.getDate()+1;\n\nlet dbts = (year*10000000000)+(month*100000000)+(day*1000000);\nlet pdbts = (pyear*10000000000)+(pmonth*100000000)+(pday*1000000);\n\nmsg.payload={}\n\n//msg.topic = \"SELECT MID(Timestamp,9,4) AS 'Tid i dag', kWh_hour AS kWh, MaxPower/1000 AS 'Max kW', CurrentPrice AS Pris FROM Energi WHERE Timestamp >= \" + dbts;\nmsg.topic = \"SELECT MID(Timestamp,9,4) AS 'I dag', PID_SP AS 'SP', ROUND(kWh_Tibber,2) AS kWh, ROUND(CurrentPrice,2) AS Pris, ROUND((CurrentPrice*kWh_Tibber), 2) AS 'Kr/h', PriceLevel AS 'Lvl' FROM Energi \";\nmsg.topic += \"WHERE Timestamp >= \" + dbts;\nmsg.topic += \" ORDER BY DatoTid ASC;\"\n//msg.topic += ', ' + verdi\n//msg.topic += ')'\nreturn msg;\n\n\n/*\nmsg.topic = \"SELECT DatoTid, kWh_hour FROM Energi WHERE Timestamp >= \" + dbts;\nmsg.topic += \" ORDER BY DatoTid ASC;\"\nmsg.payload={}\nmsg.payload.userToChange=42;\nmsg.payload.newUsername=\"example-user\";\nmsg.topic=\"INSERT INTO users (`userid`, `username`) VALUES (:userToChange, :newUsername) ON DUPLICATE KEY UPDATE `username`=:newUsername;\"\nreturn msg;\n*/","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":540,"y":1480,"wires":[["39201e04cc076738"]]},{"id":"39201e04cc076738","type":"Stackhero-MySQL","z":"d49bfe3335c3f7c9","server":"c919f77e07994edc","name":"","x":800,"y":1480,"wires":[["49ad13fd1b34421d"]]},{"id":"c8ac7ae53d71c179","type":"inject","z":"d49bfe3335c3f7c9","name":"","props":[{"p":"payload"}],"repeat":"300","crontab":"","once":false,"onceDelay":0.1,"topic":"","payloadType":"date","x":110,"y":1600,"wires":[["858128e9e731109a","fe19627f283b8bba","4d769e24aced283a","5573440bcd0ffaf6","debe875237227809","abaab949ce52216b","86ab4360.50c6c","43c98426301432b6","078aa7c160ce1cd4"]]},{"id":"25aca45ef9a7d242","type":"ui_table","z":"d49bfe3335c3f7c9","group":"188f564c824c87cd","name":"","order":4,"width":"10","height":"12","columns":[],"outputs":0,"cts":false,"x":970,"y":1520,"wires":[]},{"id":"fe19627f283b8bba","type":"function","z":"d49bfe3335c3f7c9","name":"kWh i går","func":"\nvar d = new Date();\nd.setDate(d.getDate() - 1);\nvar pd = new Date();\npd.setDate(pd.getDate() - 2);\n\nlet year = d.getFullYear();\nlet month = d.getMonth()+1;\nlet day = d.getDate()+1;\n\nlet pyear = pd.getFullYear();\nlet pmonth = pd.getMonth()+1;\nlet pday = pd.getDate()+1;\n\nlet dbts = (year*10000000000)+(month*100000000)+(day*1000000);\nlet pdbts = (pyear*10000000000)+(pmonth*100000000)+(pday*1000000);\n\nmsg.payload={}\n\n\n//msg.topic = \"SELECT MID(Timestamp,9,4) AS 'Tid i går', kWh_hour AS kWh, MaxPower/1000 AS 'Max kW', CurrentPrice AS Pris FROM Energi \";\nmsg.topic = \"SELECT MID(Timestamp,9,4) AS 'I går', PID_SP AS 'SP', ROUND(kWh_Tibber,2) AS kWh, ROUND(CurrentPrice,2) AS Pris, ROUND((CurrentPrice*kWh_Tibber), 2) AS 'Kr/h', PriceLevel AS 'Lvl' FROM Energi \";\nmsg.topic += \"WHERE Timestamp >= \" + pdbts + \" AND Timestamp < \" + dbts;\nmsg.topic += \" ORDER BY DatoTid ASC;\"\n//msg.topic += ', ' + verdi\n//msg.topic += ')'\nreturn msg;\n\n\n/*\nmsg.payload={}\nmsg.payload.userToChange=42;\nmsg.payload.newUsername=\"example-user\";\nmsg.topic=\"INSERT INTO users (`userid`, `username`) VALUES (:userToChange, :newUsername) ON DUPLICATE KEY UPDATE `username`=:newUsername;\"\nreturn msg;\n\nvar time = new Date();\nvar displaytime = time.toLocaleTimeString();\nvar hour = time.getHours();\n\n*/","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":540,"y":1520,"wires":[["94fc9523796f3ac4"]]},{"id":"94fc9523796f3ac4","type":"Stackhero-MySQL","z":"d49bfe3335c3f7c9","server":"c919f77e07994edc","name":"","x":800,"y":1520,"wires":[["25aca45ef9a7d242"]]},{"id":"d205c5ce.1feca8","type":"ui_chart","z":"d49bfe3335c3f7c9","name":"","group":"188f564c824c87cd","order":1,"width":"22","height":"6","label":"kWh/h + pris (31d)","chartType":"line","legend":"true","xformat":"HH:mm","interpolate":"linear","nodata":"","dot":false,"ymin":"","ymax":"","removeOlder":"3","removeOlderPoints":"","removeOlderUnit":"86400","cutout":0,"useOneColor":false,"useUTC":false,"colors":["#3465a4","#cc0000","#cc0000","#2ca02c","#98df8a","#d62728","#ff9896","#9467bd","#c5b0d5"],"outputs":1,"useDifferentColor":false,"className":"","x":930,"y":1440,"wires":[[]]},{"id":"86ab4360.50c6c","type":"function","z":"d49bfe3335c3f7c9","name":"Siste 31d","func":"var timeE = msg.payload;\n//Restrict the query to pull the last 24hrs\n//of data instead of the whole db\nvar d=new Date();\nd.setDate(d.getDate() - 31);\nvar aar=d.getFullYear();\nvar mnd=d.getMonth()+1; //Month er 0-11\nvar dag=d.getDate();\nvar tim=d.getHours();\n\nts = (aar*10000000000)+(mnd*100000000)+(dag*1000000)+(tim*10000);\n//msg.payload = (timeE - (1000*60*60*24));\nmsg.payload = ts;\n node.status({text:msg.payload});\nreturn msg;\n","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":340,"y":1420,"wires":[["308dd6b1.2a193a"]]},{"id":"308dd6b1.2a193a","type":"template","z":"d49bfe3335c3f7c9","name":"Format query 1","field":"topic","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"SELECT DatoTid, kWh_hour, CurrentPrice FROM Energi WHERE Timestamp > {{payload}}","output":"str","x":500,"y":1440,"wires":[["736965c2c176b373"]]},{"id":"a03b0066.3ff5a","type":"change","z":"d49bfe3335c3f7c9","name":"Format data","rules":[{"t":"set","p":"payload","pt":"msg","to":"(\t $series := [\t { \"field\": \"kWh_hour\", \"label\": \"kWh\" },\t { \"field\": \"CurrentPrice\", \"label\": \"Pris\" }\t ];\t $xaxis := \"DatoTid\";\t [\t {\t \"series\": $series.label,\t \"data\": $series.[\t (\t $yaxis := $.field;\t $$.payload.{\t \"x\": $lookup($, $xaxis),\t \"y\": $lookup($, $yaxis)\t }\t )\t ]\t }\t ]\t)","tot":"jsonata"}],"action":"","property":"","from":"","to":"","reg":false,"x":790,"y":1400,"wires":[["d205c5ce.1feca8"]]},{"id":"3016d0bf3923098b","type":"Stackhero-MySQL","z":"d49bfe3335c3f7c9","server":"c919f77e07994edc","name":"","x":700,"y":1440,"wires":[["a03b0066.3ff5a"]]},{"id":"736965c2c176b373","type":"function","z":"d49bfe3335c3f7c9","name":"Add dummy payload","func":"msg.payload = {\"Whatever\":\"0\"};\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":580,"y":1400,"wires":[["3016d0bf3923098b"]]},{"id":"6b8d58f5ed2d5568","type":"delay","z":"d49bfe3335c3f7c9","name":"","pauseType":"delay","timeout":"2","timeoutUnits":"seconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"allowrate":false,"outputs":1,"x":120,"y":1520,"wires":[["858128e9e731109a","fe19627f283b8bba","86ab4360.50c6c","4d769e24aced283a","43c98426301432b6","5573440bcd0ffaf6","debe875237227809","abaab949ce52216b","078aa7c160ce1cd4","0aca93d88df1f214"]]},{"id":"06cc550f61d82e1c","type":"show-value","z":"d49bfe3335c3f7c9","name":"","path":"","x":630,"y":1260,"wires":[["aafe6aae4f3432b7","fb78792335b9cd22"]]},{"id":"aafe6aae4f3432b7","type":"function","z":"d49bfe3335c3f7c9","name":"Lagre CurrentPrice i flow","func":"var cp = msg.payload.total;\n//cp=109.2;\nflow.set(\"CurrentPrice\",cp);\n","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":870,"y":1260,"wires":[[]]},{"id":"ae1e3d2e03e57cb0","type":"ui_table","z":"d49bfe3335c3f7c9","group":"188f564c824c87cd","name":"","order":6,"width":"10","height":"12","columns":[],"outputs":0,"cts":false,"x":970,"y":1560,"wires":[]},{"id":"4d769e24aced283a","type":"function","z":"d49bfe3335c3f7c9","name":"kWh i forgårs","func":"\nvar d = new Date();\nd.setDate(d.getDate() - 2);\nvar pd = new Date();\npd.setDate(pd.getDate() - 3);\n\nlet year = d.getFullYear();\nlet month = d.getMonth()+1;\nlet day = d.getDate()+1;\n\nlet pyear = pd.getFullYear();\nlet pmonth = pd.getMonth()+1;\nlet pday = pd.getDate()+1;\n\nlet dbts = (year*10000000000)+(month*100000000)+(day*1000000);\nlet pdbts = (pyear*10000000000)+(pmonth*100000000)+(pday*1000000);\n\n\nmsg.payload={}\n\n\n//msg.topic = \"SELECT MID(Timestamp,9,4) AS 'Tid i forgårs', kWh_hour AS kWh, MaxPower/1000 AS 'Max kW', CurrentPrice AS Pris FROM Energi \";\nmsg.topic = \"SELECT MID(Timestamp,9,4) AS 'Forgårs', PID_SP AS 'SP', ROUND(kWh_Tibber,2) AS kWh, ROUND(CurrentPrice,2) AS Pris, ROUND((CurrentPrice*kWh_Tibber), 2) AS 'Kr/h', PriceLevel AS 'Lvl' FROM Energi \";\nmsg.topic += \"WHERE Timestamp >= \" + pdbts + \" AND Timestamp < \" + dbts;\nmsg.topic += \" ORDER BY DatoTid ASC;\"\n//msg.topic += ', ' + verdi\n//msg.topic += ')'\nreturn msg;\n\n\n/*\nmsg.payload={}\nmsg.payload.userToChange=42;\nmsg.payload.newUsername=\"example-user\";\nmsg.topic=\"INSERT INTO users (`userid`, `username`) VALUES (:userToChange, :newUsername) ON DUPLICATE KEY UPDATE `username`=:newUsername;\"\nreturn msg;\n\nvar time = new Date();\nvar displaytime = time.toLocaleTimeString();\nvar hour = time.getHours();\n\n*/","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":550,"y":1560,"wires":[["39dd34e67f532e2d"]]},{"id":"39dd34e67f532e2d","type":"Stackhero-MySQL","z":"d49bfe3335c3f7c9","server":"c919f77e07994edc","name":"","x":800,"y":1560,"wires":[["ae1e3d2e03e57cb0"]]},{"id":"35e1c998ea014c70","type":"ui_table","z":"d49bfe3335c3f7c9","group":"188f564c824c87cd","name":"Kost/mnd","order":2,"width":"10","height":"3","columns":[],"outputs":0,"cts":false,"x":960,"y":1680,"wires":[]},{"id":"12e2682ce6d2f9c9","type":"function","z":"d49bfe3335c3f7c9","name":"kWh/kost pr mnd","func":"var d = new Date();\nlet hours = d.getHours();\nlet minutes = d.getMinutes();\nlet seconds = d.getSeconds();\nlet year = d.getFullYear();\nlet month = d.getMonth()+1;\nlet day = d.getDate();\nlet dbts = (year*10000000000)+(month*100000000)+(day*1000000);//+(hours*10000);\nlet dbtsy = dbts - 1000000;\nlet dbtsfy = dbtsy - 1000000;\n\nmsg.payload={}\n\n\n//msg.topic = \"SELECT MID(Timestamp,9,4) AS 'Tid i forgårs', kWh_hour AS kWh, MaxPower/1000 AS 'Max kW', CurrentPrice AS Pris FROM Energi \";\nmsg.topic = \"SELECT (LEFT(Timestamp,6)/100) AS 'År/Mnd', ROUND(SUM(kWh_Tibber),2) AS kWh, ROUND(SUM(kWh_Tibber * Currentprice),2) AS Kost \";\nmsg.topic += \"FROM Energi \";\n//msg.topic += \"WHERE Timestamp >= \" + dbtsfy + \" AND Timestamp < \" + dbtsy;\nmsg.topic += \"GROUP BY MID(Timestamp,5,2)\";\nmsg.topic += \"ORDER BY Timestamp DESC\";\n//msg.topic += ')'\nreturn msg;\n\n/*\nmsg.payload={}\nmsg.payload.userToChange=42;\nmsg.payload.newUsername=\"example-user\";\nmsg.topic=\"INSERT INTO users (`userid`, `username`) VALUES (:userToChange, :newUsername) ON DUPLICATE KEY UPDATE `username`=:newUsername;\"\nreturn msg;\n\nvar time = new Date();\nvar displaytime = time.toLocaleTimeString();\nvar hour = time.getHours();\n\n*/","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":570,"y":1680,"wires":[["f842943e2e9e0ff8"]]},{"id":"f842943e2e9e0ff8","type":"Stackhero-MySQL","z":"d49bfe3335c3f7c9","server":"c919f77e07994edc","name":"","x":800,"y":1680,"wires":[["35e1c998ea014c70"]]},{"id":"5573440bcd0ffaf6","type":"delay","z":"d49bfe3335c3f7c9","name":"","pauseType":"delay","timeout":"2","timeoutUnits":"seconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"allowrate":false,"outputs":1,"x":340,"y":1680,"wires":[["12e2682ce6d2f9c9","ac1bed130080554f"]]},{"id":"633df0a5819fbe5b","type":"comment","z":"d49bfe3335c3f7c9","name":"Hent energidata fra SQL til Dashboard","info":"","x":170,"y":1240,"wires":[]},{"id":"65e7d0fdb19c8dea","type":"ui_table","z":"d49bfe3335c3f7c9","group":"188f564c824c87cd","name":"","order":7,"width":"10","height":"12","columns":[],"outputs":0,"cts":false,"x":970,"y":1600,"wires":[]},{"id":"debe875237227809","type":"function","z":"d49bfe3335c3f7c9","name":"kWh i -3","func":"var d = new Date();\nd.setDate(d.getDate() - 3);\nvar pd = new Date();\npd.setDate(pd.getDate() - 4);\n\nlet year = d.getFullYear();\nlet month = d.getMonth()+1;\nlet day = d.getDate()+1;\n\nlet pyear = pd.getFullYear();\nlet pmonth = pd.getMonth()+1;\nlet pday = pd.getDate()+1;\n\nlet dbts = (year*10000000000)+(month*100000000)+(day*1000000);\nlet pdbts = (pyear*10000000000)+(pmonth*100000000)+(pday*1000000);\n\nmsg.payload={}\n\n\n//msg.topic = \"SELECT MID(Timestamp,9,4) AS 'Tid i forgårs', kWh_hour AS kWh, MaxPower/1000 AS 'Max kW', CurrentPrice AS Pris FROM Energi \";\nmsg.topic = \"SELECT MID(Timestamp,9,4) AS 'D-3', PID_SP AS 'SP', ROUND(kWh_Tibber,2) AS kWh, ROUND(CurrentPrice,2) AS Pris, ROUND((CurrentPrice*kWh_Tibber), 2) AS 'Kr/h', PriceLevel AS 'Lvl' FROM Energi \";\nmsg.topic += \"WHERE Timestamp >= \" + pdbts + \" AND Timestamp < \" + dbts;\nmsg.topic += \" ORDER BY DatoTid ASC;\"\n//msg.topic += ', ' + verdi\n//msg.topic += ')'\nreturn msg;\n\n\n/*\nmsg.payload={}\nmsg.payload.userToChange=42;\nmsg.payload.newUsername=\"example-user\";\nmsg.topic=\"INSERT INTO users (`userid`, `username`) VALUES (:userToChange, :newUsername) ON DUPLICATE KEY UPDATE `username`=:newUsername;\"\nreturn msg;\n\nvar time = new Date();\nvar displaytime = time.toLocaleTimeString();\nvar hour = time.getHours();\n\n*/","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":540,"y":1600,"wires":[["37297c6dd1887fc7"]]},{"id":"37297c6dd1887fc7","type":"Stackhero-MySQL","z":"d49bfe3335c3f7c9","server":"c919f77e07994edc","name":"","x":800,"y":1600,"wires":[["65e7d0fdb19c8dea"]]},{"id":"8974b41bb8d851a8","type":"ui_table","z":"d49bfe3335c3f7c9","group":"188f564c824c87cd","name":"","order":8,"width":"10","height":"12","columns":[],"outputs":0,"cts":false,"x":970,"y":1640,"wires":[]},{"id":"abaab949ce52216b","type":"function","z":"d49bfe3335c3f7c9","name":"kWh i -4","func":"var d = new Date();\nd.setDate(d.getDate() - 4);\nvar pd = new Date();\npd.setDate(pd.getDate() - 5);\n\nlet year = d.getFullYear();\nlet month = d.getMonth()+1;\nlet day = d.getDate()+1;\n\nlet pyear = pd.getFullYear();\nlet pmonth = pd.getMonth()+1;\nlet pday = pd.getDate()+1;\n\nlet dbts = (year*10000000000)+(month*100000000)+(day*1000000);\nlet pdbts = (pyear*10000000000)+(pmonth*100000000)+(pday*1000000);\n\nmsg.payload={}\n\n\n//msg.topic = \"SELECT MID(Timestamp,9,4) AS 'Tid i forgårs', kWh_hour AS kWh, MaxPower/1000 AS 'Max kW', CurrentPrice AS Pris FROM Energi \";\nmsg.topic = \"SELECT MID(Timestamp,9,4) AS 'D-4', PID_SP AS 'SP', ROUND(kWh_Tibber,2) AS kWh, ROUND(CurrentPrice,2) AS Pris, ROUND((CurrentPrice*kWh_Tibber), 2) AS 'Kr/h', PriceLevel AS 'Lvl' FROM Energi \";\nmsg.topic += \"WHERE Timestamp >= \" + pdbts + \" AND Timestamp < \" + dbts;\nmsg.topic += \" ORDER BY DatoTid ASC;\"\n//msg.topic += ', ' + verdi\n//msg.topic += ')'\nreturn msg;\n\n\n/*\nmsg.payload={}\nmsg.payload.userToChange=42;\nmsg.payload.newUsername=\"example-user\";\nmsg.topic=\"INSERT INTO users (`userid`, `username`) VALUES (:userToChange, :newUsername) ON DUPLICATE KEY UPDATE `username`=:newUsername;\"\nreturn msg;\n\nvar time = new Date();\nvar displaytime = time.toLocaleTimeString();\nvar hour = time.getHours();\n\n*/","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":540,"y":1640,"wires":[["1e38006ef2584640"]]},{"id":"1e38006ef2584640","type":"Stackhero-MySQL","z":"d49bfe3335c3f7c9","server":"c919f77e07994edc","name":"","x":800,"y":1640,"wires":[["8974b41bb8d851a8"]]},{"id":"fb78792335b9cd22","type":"function","z":"d49bfe3335c3f7c9","name":"Lagre PriceLevel i flow","func":"var cp = msg.payload.level;\n//cp=109.2;\nflow.set(\"PriceLevel\",cp);\n","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":860,"y":1220,"wires":[[]]},{"id":"d0a1b1516d131821","type":"inject","z":"d49bfe3335c3f7c9","name":"","props":[{"p":"payload"}],"repeat":"300","crontab":"","once":false,"onceDelay":0.1,"topic":"","payloadType":"date","x":110,"y":1720,"wires":[["5573440bcd0ffaf6"]]},{"id":"12c5c8eb488c16af","type":"ui_table","z":"d49bfe3335c3f7c9","group":"188f564c824c87cd","name":"Spart/dag","order":5,"width":"10","height":"9","columns":[],"outputs":0,"cts":false,"x":960,"y":1720,"wires":[]},{"id":"3b3b4a0a5fc87059","type":"function","z":"d49bfe3335c3f7c9","name":"Spart/dag","func":"var d = new Date();\nlet hours = d.getHours();\nlet minutes = d.getMinutes();\nlet seconds = d.getSeconds();\nlet year = d.getFullYear();\nlet month = d.getMonth()+1;\nlet day = d.getDate();\nlet dbts = (year*10000000000)+(month*100000000)+(day*1000000);//+(hours*10000);\nlet dbtsy = dbts - 1000000;\nlet dbtsfy = dbtsy - 1000000;\n\nmsg.payload={}\n\n\n//msg.topic = \"SELECT MID(Timestamp,9,4) AS 'Tid i forgårs', kWh_hour AS kWh, MaxPower/1000 AS 'Max kW', CurrentPrice AS Pris FROM Energi \";\n//msg.topic = \"SELECT LEFT(Timestamp,8) AS 'Dato', (SUM(CurrentPrice)/COUNT(*) * SUM(kWh_Tibber)/COUNT(*)) * 24 AS 'Snittpris', (SUM(CurrentPrice * kWh_Tibber)/COUNT(*)) * 24 AS 'ReellPri'\";\nmsg.topic = \"SELECT LEFT(Timestamp,8) AS 'Dato',\"\nmsg.topic += \"CAST(SUM(kWh_Tibber) as decimal(6,1)) AS 'kWh',\";\nmsg.topic += \"CAST(SUM(CurrentPrice)/COUNT(*) * SUM(kWh_Tibber)/COUNT(*) * 24 as decimal(10,2)) AS 'Snittpris',\";\nmsg.topic += \"CAST(SUM(CurrentPrice * kWh_Tibber)/COUNT(*) * 24 as decimal(10,2)) AS 'ReellPris',\";\nmsg.topic += \"CAST((SUM(CurrentPrice)/COUNT(*) * SUM(kWh_Tibber)/COUNT(*) * 24) - (SUM(CurrentPrice * kWh_Tibber)/COUNT(*) * 24) as decimal(10,2)) AS 'Spart'\"\n\nmsg.topic += \"FROM Energi \";\n//msg.topic += \"WHERE Timestamp >= \" + dbtsfy + \" AND Timestamp < \" + dbtsy;\nmsg.topic += \"GROUP BY LEFT(Timestamp,8)\";\nmsg.topic += \"ORDER BY Timestamp DESC\";\n//msg.topic += ')'\nreturn msg;\n\n/*\nmsg.payload={}\nmsg.payload.userToChange=42;\nmsg.payload.newUsername=\"example-user\";\nmsg.topic=\"INSERT INTO users (`userid`, `username`) VALUES (:userToChange, :newUsername) ON DUPLICATE KEY UPDATE `username`=:newUsername;\"\nreturn msg;\n\nvar time = new Date();\nvar displaytime = time.toLocaleTimeString();\nvar hour = time.getHours();\n\n*/","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":540,"y":1720,"wires":[["bfad0741bbc43305"]]},{"id":"bfad0741bbc43305","type":"Stackhero-MySQL","z":"d49bfe3335c3f7c9","server":"c919f77e07994edc","name":"","x":800,"y":1720,"wires":[["12c5c8eb488c16af"]]},{"id":"ac1bed130080554f","type":"delay","z":"d49bfe3335c3f7c9","name":"","pauseType":"delay","timeout":"2","timeoutUnits":"seconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"allowrate":false,"outputs":1,"x":400,"y":1720,"wires":[["3b3b4a0a5fc87059"]]},{"id":"7b554e4669b367f9","type":"ui_chart","z":"d49bfe3335c3f7c9","name":"","group":"188f564c824c87cd","order":1,"width":"8","height":"6","label":"kWh/h + pris (2d)","chartType":"line","legend":"true","xformat":"HH:mm","interpolate":"linear","nodata":"","dot":false,"ymin":"0","ymax":"","removeOlder":"3","removeOlderPoints":"","removeOlderUnit":"86400","cutout":0,"useOneColor":false,"useUTC":false,"colors":["#3465a4","#cc0000","#73d216","#2ca02c","#98df8a","#d62728","#ff9896","#9467bd","#c5b0d5"],"outputs":1,"useDifferentColor":false,"className":"","x":930,"y":1360,"wires":[[]]},{"id":"078aa7c160ce1cd4","type":"function","z":"d49bfe3335c3f7c9","name":"Siste 2d","func":"var timeE = msg.payload;\n//Restrict the query to pull the last 24hrs\n//of data instead of the whole db\nvar d=new Date();\nd.setDate(d.getDate() - 2);\nvar aar=d.getFullYear();\nvar mnd=d.getMonth()+1; //Month er 0-11\nvar dag=d.getDate();\nvar tim=d.getHours();\n\nts = (aar*10000000000)+(mnd*100000000)+(dag*1000000)+(tim*10000);\n//msg.payload = (timeE - (1000*60*60*24));\nmsg.payload = ts;\n node.status({text:msg.payload});\nreturn msg;\n","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":340,"y":1340,"wires":[["38c38a3dabaa53dc"]]},{"id":"38c38a3dabaa53dc","type":"template","z":"d49bfe3335c3f7c9","name":"Format query 1","field":"topic","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"SELECT DatoTid, kWh_hour, CurrentPrice, PID_SP FROM Energi WHERE Timestamp > {{payload}}","output":"str","x":500,"y":1360,"wires":[["0a3c6d550a427301"]]},{"id":"b6b43742bb23be7f","type":"change","z":"d49bfe3335c3f7c9","name":"Format data","rules":[{"t":"set","p":"payload","pt":"msg","to":"(\t $series := [\t { \"field\": \"kWh_hour\", \"label\": \"kWh\" },\t { \"field\": \"CurrentPrice\", \"label\": \"Pris\" },\t { \"field\": \"PID_SP\", \"label\": \"SP\" }\t ];\t $xaxis := \"DatoTid\";\t [\t {\t \"series\": $series.label,\t \"data\": $series.[\t (\t $yaxis := $.field;\t $$.payload.{\t \"x\": $lookup($, $xaxis),\t \"y\": $lookup($, $yaxis)\t }\t )\t ]\t }\t ]\t)","tot":"jsonata"}],"action":"","property":"","from":"","to":"","reg":false,"x":790,"y":1320,"wires":[["7b554e4669b367f9"]]},{"id":"324130bee0fc15b3","type":"Stackhero-MySQL","z":"d49bfe3335c3f7c9","server":"c919f77e07994edc","name":"","x":700,"y":1360,"wires":[["b6b43742bb23be7f"]]},{"id":"0a3c6d550a427301","type":"function","z":"d49bfe3335c3f7c9","name":"Add dummy payload","func":"msg.payload = {\"Whatever\":\"0\"};\nreturn msg;\n// Fjernet fra Format data\n// { \"field\": \"DateTime\", \"label\": \"Tid\" },\n","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":580,"y":1320,"wires":[["324130bee0fc15b3"]]},{"id":"0aca93d88df1f214","type":"hs-device","z":"d49bfe3335c3f7c9","name":"RedusertEffekt","device":"1762","server":"8cea2f7d775df12f","feature":"1763","reportonstartup":false,"x":440,"y":1060,"wires":[["7c1234ae0ca72d65","a2c5e93546b26393"]]},{"id":"7c1234ae0ca72d65","type":"change","z":"d49bfe3335c3f7c9","name":"Set global.reduserteffekt","rules":[{"t":"set","p":"reduserteffekt","pt":"global","to":"payload.status","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":750,"y":1020,"wires":[[]]},{"id":"337d0b425331896c","type":"comment","z":"d49bfe3335c3f7c9","name":"Set global.reduserteffekt","info":"","x":470,"y":1020,"wires":[]},{"id":"a2c5e93546b26393","type":"change","z":"d49bfe3335c3f7c9","name":"Set global.reduserteffekt_value","rules":[{"t":"set","p":"reduserteffekt_value","pt":"global","to":"payload.value","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":770,"y":1060,"wires":[[]]},{"id":"3235237809bb894f","type":"tibber-api-endpoint","feedUrl":"wss://api.tibber.com/v1-beta/gql/subscriptions","queryUrl":"https://api.tibber.com/v1-beta/gql","name":"Dale"},{"id":"c919f77e07994edc","type":"Stackhero-MySQL-Server","name":"","host":"172.16.0.98","port":"3306","tls":false,"database":"NodeRedEnergi"},{"id":"188f564c824c87cd","type":"ui_group","name":"Chart","tab":"bbe9ae4be8e5f235","order":4,"disp":false,"width":"30","collapse":false,"className":""},{"id":"8cea2f7d775df12f","type":"hs-server","name":"HS4","host":"172.16.0.102","port":"80"},{"id":"bbe9ae4be8e5f235","type":"ui_tab","name":"Energi","icon":"receipt","order":2,"disabled":false,"hidden":false}]
-
Enkleste måten: Om dimmeren støtter transtion kan du sende f.eks denne: {"brightness":120,"transition":60}
-
Jeg har hatt flaks om MyWeather har virket sammenhengende i en uke. Normalt når den henger er det bare å stoppe/starte plugin så våkne den igjen men ikke de siste dagene. I dag hadde den startet av seg selv og var overraskende nok oppdatert...
-
Jepp: https://smartlight.me/smart-home-devices/zigbee-devices/zigbee-coordinator-v4-cc2652p
- 17 svar
-
- 1
-
Jeg handlet direkte fra Ukraina, litt billigere og funket supert. De er litt omstendelige med formaliteter men det føltes trygt og gikk smertefritt.
- 17 svar
-
- 1
-
Jepp, skjønner den. Det var ikke ment som kritikk, bare at jeg mener bildet blir litt misvisende slik TibberSeer viser det.
-
Ser prisgrafen til TibberSeer har dynamisk skala og gir et annet bilde av prisutviklingen så jeg laget begge variantene i NodeRed for sammenligning: [{"id":"c62340730470ca2c","type":"function","z":"7aa23003bb64f180","name":"","func":"var d = new Date();\nd.setDate(d.getDate());\nlet currHour = d.getHours();\n\n\nmsg.topic = msg.payload.viewer.homes[0].currentSubscription.priceInfo.today[0].startsAt.split(\":00+\")[0].split(\"T\")[0];\nmsg.payloadorg = msg.payload;\nmsg.payload = [{\"series\":[\"Totals\",\"\"], \"data\": [[],[]], \"labels\": []}];\nfor ( var i in msg.payloadorg.viewer.homes[0].currentSubscription.priceInfo.today ){\n msg.payload[0].data[0][i] = msg.payloadorg.viewer.homes[0].currentSubscription.priceInfo.today[i].total;\n // Add \"Now\" marker\n if (msg.payloadorg.viewer.homes[0].currentSubscription.priceInfo.today[i].startsAt.slice(11,13) == currHour)\n msg.payload[0].data[1][i] = 100;\n else\n msg.payload[0].data[1][i] = -1;\n msg.payload[0].labels[i] = msg.payloadorg.viewer.homes[0].currentSubscription.priceInfo.today[i].startsAt.slice(11,13);\n}\n// Quick and dirty fix: legg till time 24\nmsg.payload[0].data[0][24] = msg.payloadorg.viewer.homes[0].currentSubscription.priceInfo.today[23].total;\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":880,"y":120,"wires":[["b4e71d585aa269bc"]]},{"id":"b4e71d585aa269bc","type":"ui_chart","z":"7aa23003bb64f180","name":"elpriser i dag","group":"f92abb1b.7c98d8","order":3,"width":"15","height":"7","label":"{{msg.topic}}","chartType":"line","legend":"false","xformat":"HH","interpolate":"step","nodata":"","dot":true,"ymin":"0","ymax":"6","removeOlder":"24","removeOlderPoints":"","removeOlderUnit":"3600","cutout":0,"useOneColor":true,"useUTC":false,"colors":["#3465a4","#73d216","#ff7f0e","#2ca02c","#98df8a","#d62728","#ff9896","#9467bd","#c5b0d5"],"outputs":1,"useDifferentColor":false,"className":"","x":1050,"y":120,"wires":[[]]},{"id":"a6ace43237857ffb","type":"tibber-query","z":"7aa23003bb64f180","name":"","active":true,"apiEndpointRef":"3235237809bb894f","x":690,"y":120,"wires":[["c62340730470ca2c","0215a6e0c99061b7"]]},{"id":"eaf8dbce27c1d3f5","type":"function","z":"7aa23003bb64f180","name":"","func":"msg.topic = msg.payload.viewer.homes[0].currentSubscription.priceInfo.tomorrow[0].startsAt.split(\":00+\")[0].split(\"T\")[0];\nmsg.payloadorg = msg.payload;\nmsg.payload = [{\"series\":[\"Totals\"], \"data\": [[]], \"labels\": []}];\nfor ( var i in msg.payloadorg.viewer.homes[0].currentSubscription.priceInfo.tomorrow){\n msg.payload[0].data[0][i] = msg.payloadorg.viewer.homes[0].currentSubscription.priceInfo.tomorrow[i].total;\n msg.payload[0].labels[i] = msg.payloadorg.viewer.homes[0].currentSubscription.priceInfo.tomorrow[i].startsAt.slice(11,13);\n}\n// Quick and dirty fix: legg till time 24\nmsg.payload[0].data[0][24] = msg.payloadorg.viewer.homes[0].currentSubscription.priceInfo.tomorrow[23].total;\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":880,"y":220,"wires":[["c59a5b5038bdf489","7f3ff9455e7af2f8"]]},{"id":"c59a5b5038bdf489","type":"ui_chart","z":"7aa23003bb64f180","name":"elpriser i morgen","group":"f92abb1b.7c98d8","order":4,"width":"15","height":"7","label":"{{msg.topic}}","chartType":"line","legend":"false","xformat":"HH","interpolate":"step","nodata":"","dot":true,"ymin":"0","ymax":"6","removeOlder":1,"removeOlderPoints":"","removeOlderUnit":"3600","cutout":0,"useOneColor":true,"useUTC":false,"colors":["#3465a4","#aec7e8","#ff7f0e","#2ca02c","#98df8a","#d62728","#ff9896","#9467bd","#c5b0d5"],"outputs":1,"useDifferentColor":false,"className":"","x":1070,"y":220,"wires":[[]]},{"id":"f31f9d17a8603b23","type":"tibber-query","z":"7aa23003bb64f180","name":"","active":true,"apiEndpointRef":"3235237809bb894f","x":690,"y":220,"wires":[["eaf8dbce27c1d3f5"]]},{"id":"f3e66847271be197","type":"change","z":"7aa23003bb64f180","name":"I dag","rules":[{"t":"set","p":"payload","pt":"msg","to":"{ viewer { homes { currentSubscription { priceInfo { today { total energy tax startsAt } } } } }}","tot":"str"},{"t":"set","p":"topic","pt":"msg","to":"tod","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":470,"y":120,"wires":[["a6ace43237857ffb"]]},{"id":"025c7b81cb113a53","type":"change","z":"7aa23003bb64f180","name":"I morgen","rules":[{"t":"set","p":"payload","pt":"msg","to":"{ viewer { homes { currentSubscription { priceInfo { tomorrow { total energy tax startsAt } } } } }}","tot":"str"},{"t":"set","p":"topic","pt":"msg","to":"tom","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":480,"y":220,"wires":[["f31f9d17a8603b23"]]},{"id":"a4b2b795ecb5b85e","type":"cronplus","z":"7aa23003bb64f180","name":"","outputField":"payload","timeZone":"","persistDynamic":false,"commandResponseMsgOutput":"output1","outputs":1,"options":[{"name":"schedule1","topic":"schedule1","payloadType":"date","payload":"","expressionType":"cron","expression":"0 0 * * * * *","location":"","offset":"0","solarType":"all","solarEvents":"sunrise,sunset"}],"x":100,"y":160,"wires":[["c92a61e1962e10a2"]]},{"id":"c92a61e1962e10a2","type":"delay","z":"7aa23003bb64f180","name":"","pauseType":"delay","timeout":"2","timeoutUnits":"seconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"allowrate":false,"outputs":1,"x":280,"y":140,"wires":[["f3e66847271be197","025c7b81cb113a53"]]},{"id":"0215a6e0c99061b7","type":"function","z":"7aa23003bb64f180","name":"","func":"var d = new Date();\nd.setDate(d.getDate());\nlet currHour = d.getHours();\n\n\nmsg.topic = msg.payload.viewer.homes[0].currentSubscription.priceInfo.today[0].startsAt.split(\":00+\")[0].split(\"T\")[0];\nmsg.payloadorg = msg.payload;\nmsg.payload = [{\"series\":[\"Totals\",\"\"], \"data\": [[],[]], \"labels\": []}];\nfor ( var i in msg.payloadorg.viewer.homes[0].currentSubscription.priceInfo.today ){\n msg.payload[0].data[0][i] = msg.payloadorg.viewer.homes[0].currentSubscription.priceInfo.today[i].total;\n // Add \"Now\" marker\n/* if (msg.payloadorg.viewer.homes[0].currentSubscription.priceInfo.today[i].startsAt.slice(11,13) == currHour)\n msg.payload[0].data[1][i] = 2;\n else\n msg.payload[0].data[1][i] = 0;*/\n msg.payload[0].labels[i] = msg.payloadorg.viewer.homes[0].currentSubscription.priceInfo.today[i].startsAt.slice(11,13);\n}\n// Quick and dirty fix: legg till time 24\nmsg.payload[0].data[0][24] = msg.payloadorg.viewer.homes[0].currentSubscription.priceInfo.today[23].total;\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":880,"y":160,"wires":[["e2eb38f705911a33"]]},{"id":"e2eb38f705911a33","type":"ui_chart","z":"7aa23003bb64f180","name":"elpriser i dag dyn y","group":"f92abb1b.7c98d8","order":1,"width":"15","height":"7","label":"{{msg.topic}}","chartType":"line","legend":"false","xformat":"HH","interpolate":"step","nodata":"","dot":true,"ymin":"","ymax":"","removeOlder":"24","removeOlderPoints":"","removeOlderUnit":"3600","cutout":0,"useOneColor":true,"useUTC":false,"colors":["#3465a4","#73d216","#ff7f0e","#2ca02c","#98df8a","#d62728","#ff9896","#9467bd","#c5b0d5"],"outputs":1,"useDifferentColor":false,"className":"","x":1070,"y":160,"wires":[[]]},{"id":"7f3ff9455e7af2f8","type":"ui_chart","z":"7aa23003bb64f180","name":"elpriser i morgen dyn y","group":"f92abb1b.7c98d8","order":2,"width":"15","height":"7","label":"{{msg.topic}}","chartType":"line","legend":"false","xformat":"HH","interpolate":"step","nodata":"","dot":true,"ymin":"","ymax":"","removeOlder":1,"removeOlderPoints":"","removeOlderUnit":"3600","cutout":0,"useOneColor":true,"useUTC":false,"colors":["#3465a4","#aec7e8","#ff7f0e","#2ca02c","#98df8a","#d62728","#ff9896","#9467bd","#c5b0d5"],"outputs":1,"useDifferentColor":false,"className":"","x":1080,"y":260,"wires":[[]]},{"id":"f92abb1b.7c98d8","type":"ui_group","name":"Strømpris","tab":"69a5e334.ac1d1c","order":4,"disp":true,"width":"30","collapse":false,"className":""},{"id":"3235237809bb894f","type":"tibber-api-endpoint","feedUrl":"wss://api.tibber.com/v1-beta/gql/subscriptions","queryUrl":"https://api.tibber.com/v1-beta/gql","name":"Dale"},{"id":"69a5e334.ac1d1c","type":"ui_tab","name":"Hem","icon":"attach_money","order":1,"disabled":false,"hidden":false}]
-
Kan ikke sammenligne stort men jeg bruker CC2652P og Zigbee2MQTT og det funker supert. Hadde tidligere en Raspbee 2 men oppgraderte da CC2652P ble anbefalt til Zigbee2MQTT. Raspbee 2 funket også godt men jeg hadde noen ganger problem med at den ikke ville starte opp ved reboot.
-
NAS eller ekstern disk på server for backup?
SveinHa svarte på Nettopp sitt emne i Annen Elektronikk
Jeg har hatt en Netgear NAS i en ti års tid og da jeg tenkte det var på tide med en oppgradering havnet jeg på Synology DS220+ og det må jeg si ble en ny verden. Av de tingene jeg benytter meg av så er det bl.a. VPN server slik at jeg kommer inn på lokalnettet mitt uten å åpne noen porter Synology Drive for fildeling lignende DropBox Fotobackup og arkivering med ansiktsgjenkjenning Backup av komplette virtuelle ESXI maskiner online SQL server (MariaDB) En haug med andre funksjoner innebygget og inkludert i prisen der det bare er beskjedent hva jeg har tatt i bruk... Netgearen blir backup for Synology så da får jeg litt ekstra gratis sikkerhet der. De 2 NASene er plassert i separate bygninger utenom hovedhuset så det gir også en del ekstra sikkerhet.- 3 svar
-
- 1
-
Vannfallrettighetsloven fra 1917 er fremdeles gjeldende.
SveinHa svarte på SveinHa sitt emne i Automasjonskaféen
Akkurat DER har jeg min sterke tvil... Noen som har tall på de milliardene som pøses ut over landegrensene til prosjekter uten kvalitetssikring? -
Vannfallrettighetsloven fra 1917 er fremdeles gjeldende.
SveinHa svarte på SveinHa sitt emne i Automasjonskaféen
Leste en plass at det var snakk om 50% men synes jo det høres veldig mye ut. -
Da har jeg bygget litt videre på løsningen til @oevensen og det er blitt seende slik ut: Jeg har valgt å ha faste y-akse grenser fordi det gir et renere bildet av prisen, spesielt viktig å ha fast 0-punkt. Max er 12 i dette tilfellet og det bør nå holde noen dager... Markeringen av inneværende time har enten verdien -1 eller 100 for å bevisst gå utenfor skalaen. Om en setter opp dynamisk skala bør disse verdiene endres. I bildet her "mangler" timen fra 23:00 til 23:59 så der er en liten quick and dirty fix for det i flowen nå... Timestamp injektoren oppdaterer i ny og ne og er vel egentlig helt unødvendig bortsett fra i den timen nye priser dukker opp (litt over kl 13) mens cron-plus trigger hvert timeskift. [{"id":"c62340730470ca2c","type":"function","z":"7aa23003bb64f180","name":"","func":"var d = new Date();\nd.setDate(d.getDate());\nlet currHour = d.getHours();\n\n\nmsg.topic = msg.payload.viewer.homes[0].currentSubscription.priceInfo.today[0].startsAt.split(\":00+\")[0].split(\"T\")[0];\nmsg.payloadorg = msg.payload;\nmsg.payload = [{\"series\":[\"Totals\",\"\"], \"data\": [[],[]], \"labels\": []}];\nfor ( var i in msg.payloadorg.viewer.homes[0].currentSubscription.priceInfo.today ){\n msg.payload[0].data[0][i] = msg.payloadorg.viewer.homes[0].currentSubscription.priceInfo.today[i].total;\n // Add \"Now\" marker\n if (msg.payloadorg.viewer.homes[0].currentSubscription.priceInfo.today[i].startsAt.slice(11,13) == currHour)\n msg.payload[0].data[1][i] = 100;\n else\n msg.payload[0].data[1][i] = -1;\n msg.payload[0].labels[i] = msg.payloadorg.viewer.homes[0].currentSubscription.priceInfo.today[i].startsAt.slice(11,13);\n}\n// Quick and dirty fix: legg till time 24\nmsg.payload[0].data[0][24] = msg.payloadorg.viewer.homes[0].currentSubscription.priceInfo.today[23].total;\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":680,"y":120,"wires":[["b4e71d585aa269bc"]]},{"id":"b4e71d585aa269bc","type":"ui_chart","z":"7aa23003bb64f180","name":"elpriser i dag","group":"f92abb1b.7c98d8","order":1,"width":"15","height":"10","label":"{{msg.topic}}","chartType":"line","legend":"false","xformat":"HH","interpolate":"step","nodata":"","dot":true,"ymin":"0","ymax":"12","removeOlder":"24","removeOlderPoints":"","removeOlderUnit":"3600","cutout":0,"useOneColor":true,"useUTC":false,"colors":["#3465a4","#73d216","#ff7f0e","#2ca02c","#98df8a","#d62728","#ff9896","#9467bd","#c5b0d5"],"outputs":1,"useDifferentColor":false,"className":"","x":850,"y":120,"wires":[[]]},{"id":"a6ace43237857ffb","type":"tibber-query","z":"7aa23003bb64f180","name":"","active":true,"apiEndpointRef":"3235237809bb894f","x":490,"y":120,"wires":[["c62340730470ca2c"]]},{"id":"eaf8dbce27c1d3f5","type":"function","z":"7aa23003bb64f180","name":"","func":"msg.topic = msg.payload.viewer.homes[0].currentSubscription.priceInfo.tomorrow[0].startsAt.split(\":00+\")[0].split(\"T\")[0];\nmsg.payloadorg = msg.payload;\nmsg.payload = [{\"series\":[\"Totals\"], \"data\": [[]], \"labels\": []}];\nfor ( var i in msg.payloadorg.viewer.homes[0].currentSubscription.priceInfo.tomorrow){\n msg.payload[0].data[0][i] = msg.payloadorg.viewer.homes[0].currentSubscription.priceInfo.tomorrow[i].total;\n msg.payload[0].labels[i] = msg.payloadorg.viewer.homes[0].currentSubscription.priceInfo.tomorrow[i].startsAt.slice(11,13);\n}\n// Quick and dirty fix: legg till time 24\nmsg.payload[0].data[0][24] = msg.payloadorg.viewer.homes[0].currentSubscription.priceInfo.tomorrow[23].total;\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":680,"y":160,"wires":[["c59a5b5038bdf489"]]},{"id":"c59a5b5038bdf489","type":"ui_chart","z":"7aa23003bb64f180","name":"elpriser i morgen","group":"f92abb1b.7c98d8","order":2,"width":"15","height":"10","label":"{{msg.topic}}","chartType":"line","legend":"false","xformat":"HH","interpolate":"step","nodata":"","dot":true,"ymin":"0","ymax":"12","removeOlder":1,"removeOlderPoints":"","removeOlderUnit":"3600","cutout":0,"useOneColor":true,"useUTC":false,"colors":["#3465a4","#aec7e8","#ff7f0e","#2ca02c","#98df8a","#d62728","#ff9896","#9467bd","#c5b0d5"],"outputs":1,"useDifferentColor":false,"className":"","x":870,"y":160,"wires":[[]]},{"id":"f31f9d17a8603b23","type":"tibber-query","z":"7aa23003bb64f180","name":"","active":true,"apiEndpointRef":"3235237809bb894f","x":490,"y":160,"wires":[["eaf8dbce27c1d3f5"]]},{"id":"f3e66847271be197","type":"change","z":"7aa23003bb64f180","name":"I dag","rules":[{"t":"set","p":"payload","pt":"msg","to":"{ viewer { homes { currentSubscription { priceInfo { today { total energy tax startsAt } } } } }}","tot":"str"},{"t":"set","p":"topic","pt":"msg","to":"tod","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":270,"y":120,"wires":[["a6ace43237857ffb"]]},{"id":"7d0b8eb209428eeb","type":"inject","z":"7aa23003bb64f180","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"600","crontab":"","once":false,"onceDelay":0.1,"topic":"","payloadType":"date","x":110,"y":120,"wires":[["f3e66847271be197","025c7b81cb113a53"]]},{"id":"025c7b81cb113a53","type":"change","z":"7aa23003bb64f180","name":"I morgen","rules":[{"t":"set","p":"payload","pt":"msg","to":"{ viewer { homes { currentSubscription { priceInfo { tomorrow { total energy tax startsAt } } } } }}","tot":"str"},{"t":"set","p":"topic","pt":"msg","to":"tom","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":280,"y":160,"wires":[["f31f9d17a8603b23"]]},{"id":"a4b2b795ecb5b85e","type":"cronplus","z":"7aa23003bb64f180","name":"","outputField":"payload","timeZone":"","persistDynamic":false,"commandResponseMsgOutput":"output1","outputs":1,"options":[{"name":"schedule1","topic":"schedule1","payloadType":"default","payload":"","expressionType":"cron","expression":"0 0 * * * * *","location":"","offset":"0","solarType":"all","solarEvents":"sunrise,sunset"}],"x":100,"y":160,"wires":[["f3e66847271be197","025c7b81cb113a53"]]},{"id":"f92abb1b.7c98d8","type":"ui_group","name":"Strømpris","tab":"69a5e334.ac1d1c","order":4,"disp":true,"width":"30","collapse":false,"className":""},{"id":"3235237809bb894f","type":"tibber-api-endpoint","feedUrl":"wss://api.tibber.com/v1-beta/gql/subscriptions","queryUrl":"https://api.tibber.com/v1-beta/gql","name":"Dale"},{"id":"69a5e334.ac1d1c","type":"ui_tab","name":"Hem","icon":"attach_money","order":1,"disabled":false,"hidden":false}]
-
Vannfallrettighetsloven fra 1917 er fremdeles gjeldende.
SveinHa svarte på SveinHa sitt emne i Automasjonskaféen
Vannkraften har bygget landet og lagt grunnlaget for viktig industri, den har ALLTID vært et verktøy for å sikre nasjonal velstand. Oljen har på mange måter ødelagt de gode egenskapene vi nordmenn har hatt. Selvsagt har oljen bidratt vesentlig til bedre levevilkår for folk generelt men samtidig har den produsert en mengde ufyselige individer som ser grådighet som sin livsgjerning. Vi har jo så mye penger her til lands at vi ikke har råd til noen ting lengre, systematisk nedbygging av goder opparbeidet gjennom utallige tiår forsvinner, bedrifter får ikke støtte om de sliter med driften men får støtte for å flytte produksjonen utenlands. Der er alt for mye til å ramse opp men det pinlige her er de forkvaklede skapningene som tror at penger løser alle problem... Kapitalismen har aldri løst noen som helst sosiale problemer men fy fader hvor mange den har skapt... Jeg har stor tro på at det vi ser i disse dager er kapitalismen som skyter seg selv i foten og går til grunne... og det er kanskje like greit... Det er jo et godt poeng men SKJER det? Vi flås over strømregningen og får knapper og glansbilder tilbake... -
Vannfallrettighetsloven fra 1917 er fremdeles gjeldende.
SveinHa svarte på SveinHa sitt emne i Automasjonskaféen
Slik snakker en ekte blåruss som kun ser penger som det endelige målet for lykke... Oljeproduksjonen blir en helt annen sak fordi vi sitter på så hinsides større mengder enn vi kan klare å bruke selv, vannkraft har vi bare et ganske beskjedent overskudd av. -
Vannfallrettighetsloven fra 1917 er fremdeles gjeldende.
SveinHa svarte på SveinHa sitt emne i Automasjonskaféen
I hele min levetid har det vært offisiell politikk at vannkraften SKAL brukes fremfor andre alternativer fordi den er billig, ren og fornybar. Nå, når alternativene er blitt forbudt, endres spillereglene (men ikke loven)... Jeg som hele livet har spilt Ludo havner plutselig i en heftig klespoker... Sendte nettopp epost til Stasministerens kontor med samme spørsmål. Har ikke tro på at det hjelper en nanometer, sist jeg sendte 2-3 eposter i den retningen blokkerte de min epost... -
Vannfallrettighetsloven fra 1917 er fremdeles gjeldende.
SveinHa publiserte et emne i Automasjonskaféen
Hvordan kan det ha seg at landets ledelse ikke kan lese normal norsk??? Vannfallrettighetsloven fra 1917 er fremdeles gjeldende: "§ 1.Formål Landets vannkraftressurser tilhører og skal forvaltes til beste for allmennheten. Dette skal sikres gjennom offentlig eierskap på statlig, fylkeskommunalt og kommunalt nivå." https://lovdata.no/dokument/NL/lov/1917-12-14-16- 15 svar
-
- 2
-
Kjører også HomeSeer med Z-Wave men har etterhvert funnet ut at Zigbee mye bedre/pålitelig, mesher myyye bedre. Med HomeSeer sine begrensede brukergrensesnitt så har jeg flyttet halvveis over på NodeRed. HS og NR er 2 vidt forskjellige verdener så det tok en del tid å justere hodet inn på NR men det begynner å komme seg. Begge systemene har både gode og dårlige egenskaper og utfyller hverandre godt og snakker med hverandre.
-
Ikke dumt det der. Jeg hadde en lignende i forrige huset koblet til en 3000 l vanntank. Svelget unna godt med ved... En stappfull vedboks med god haug på ga varme til hele huset via vannbåren gulvvarme og konvektorer hele dagen og tilsvarende fyring om kvelden ga varme i hele huset gjennom natten. Tanken hadde uttak for både lavtemperatur til gulvvarme og høytemp til dusjvann. Greit med tilnærmet ubegrenset med varmtvann...
- 188 svar
-
- 2
-
Det er mange år siden jeg sa at strømmen skulle MINST 3-dobles og gjerne mer innen få år og folk bare lo... Det har jo vært lett å se hvilken vei strømmarkedet gikk.
- 188 svar
-
- 1
-
Har putlet litt mer med NodeRed Dashboard og laget meg 2-3 bilder som gir meg god oversikt over energiforbruket i huset. Først de største forbrukerene med PID regulator, krampesparing i dag med all-time-high strømpris så langt, blir verre i morgen: Kun PID for litt god oversikt for tuning: Og til sist: Henting og visning av loggede data fra SQL:
- 7 svar
-
- 1