Skip to content

Instantly share code, notes, and snippets.

@jisotalo
Created December 16, 2023 10:18
Show Gist options
  • Save jisotalo/9b941a8c4dc74064c499e4ff2f1ff27f to your computer and use it in GitHub Desktop.
Save jisotalo/9b941a8c4dc74064c499e4ff2f1ff27f to your computer and use it in GitHub Desktop.
shelly-porssisahko 2.9.0 test version 2
let C_HIST=24,C_ERRC=3,C_ERRD=120,C_DEF={mode:0,m0:{cmd:0},m1:{lim:0},m2:{per:24,cnt:0,lim:-999,sq:0,m:999},vat:24,day:0,night:0,bk:0,err:0,outs:[0],fh:0,inv:0},c={s:{v:"2.9.0",dn:"",st:0,cmd:0,chkTs:0,errCnt:0,errTs:0,upTs:0,timeOK:0,configOK:0,fCmdTs:0,tz:"+02:00",p:{ts:0,now:0,low:0,high:0,avg:0}},p:[],h:[],c:C_DEF},l=!1,o=!1;function i(t,e){e-=t;return 0<=e&&e<3600}function f(t){return Math.floor((t?t.getTime():Date.now())/1e3)}function n(t,e,s){let n=t.toString();for(;n.length<e;)n=s?s+n:" "+n;return n}function u(t){return t.getDate()}function r(t){let e=t.toString();(e="+0000"==(e=e.substring(3+e.indexOf("GMT")))?"Z":e.substring(0,3)+":"+e.substring(3))!=c.s.tz&&(c.s.p.ts=0),c.s.tz=e}function a(t,e){console.log((new Date).toISOString().substring(11)+": "+(e?e+" - ":""),t)}function b(){var t=new Date;c.s.timeOK=2e3<t.getFullYear()?1:0,c.s.dn=Shelly.getComponentConfig("sys").device.name,!c.s.upTs&&c.s.timeOK&&(c.s.upTs=f(t))}function p(t){Shelly.call("KVS.Get",{key:"porssi-config"},function(e,t,s,n){c.c=e?e.value:{},"function"==typeof USER_CONFIG&&(c.c=USER_CONFIG(c.c));{e=function(t){c.s.configOK=t?1:0,c.s.chkTs=0,n&&(l=!1,g())};let t=0;if(C_DEF){for(var r in C_DEF)if(void 0===c.c[r])c.c[r]=C_DEF[r],t++;else if("object"==typeof C_DEF[r])for(var o in C_DEF[r])void 0===c.c[r][o]&&(c.c[r][o]=C_DEF[r][o],t++);void 0!==c.c.out&&(c.c.outs=[c.c.out],c.c.out=void 0),C_DEF=null,0<t?Shelly.call("KVS.Set",{key:"porssi-config",value:c.c},function(t,e,s,n){n&&n(0===e)},e):e&&e(!0)}else e&&e(!0)}},t)}function g(){if(!l)if(l=!0,b(),c.s.configOK)if(function(){let t=new Date,e=!1;e=c.s.timeOK&&(0===c.s.p.ts||u(new Date(1e3*c.s.p.ts))!==u(t)),c.s.errCnt>=C_ERRC&&f(t)-c.s.errTs<C_ERRD?(C_ERRD,f(t),c.s.errTs,e=!1):c.s.errCnt>=C_ERRC&&(c.s.errCnt=0);return e}()){let e=new Date;r(e);try{let t=e.getFullYear()+"-"+n(1+e.getMonth(),2,"0")+"-"+n(u(e),2,"0")+"T00:00:00"+c.s.tz.replace("+","%2b");var s=t.replace("T00:00:00","T23:59:59");let l={url:"https://dashboard.elering.ee/api/nps/price/csv?fields=fi&start="+t+"&end="+s,timeout:5,ssl_ca:"*"};e=null,t=null,Shelly.call("HTTP.GET",l,function(e,t,s){l=null;try{if(0!==t||null==e||200!==e.code||!e.body_b64)throw Error("conn.err ("+s+") "+JSON.stringify(e));{e.headers=null,s=e.message=null,c.p=[],c.s.p.high=-999,c.s.p.low=999,e.body_b64=atob(e.body_b64),e.body_b64=e.body_b64.substring(1+e.body_b64.indexOf("\n"));let t=0;for(;0<=t;){e.body_b64=e.body_b64.substring(t);var n=[t=0,0];if(0===(t=1+e.body_b64.indexOf('"',t)))break;n[0]=+e.body_b64.substring(t,e.body_b64.indexOf('"',t)),t=2+e.body_b64.indexOf('"',t),t=2+e.body_b64.indexOf(';"',t),n[1]=+(""+e.body_b64.substring(t,e.body_b64.indexOf('"',t)).replace(",",".")),n[1]=n[1]/10*(100+(0<n[1]?c.c.vat:0))/100;var r=new Date(1e3*n[0]).getHours();n[1]+=7<=r&&r<22?c.c.day:c.c.night,c.p.push(n),c.s.p.avg+=n[1],n[1]>c.s.p.high&&(c.s.p.high=n[1]),n[1]<c.s.p.low&&(c.s.p.low=n[1]),t=e.body_b64.indexOf("\n",t)}e=null,c.s.p.avg=0<c.p.length?c.s.p.avg/c.p.length:0;var o=new Date,i=new Date(1e3*c.p[0][0]);if(u(i)!==u(o))throw Error("date err "+o.toString()+" - "+i.toString());c.s.p.ts=f(o),c.s.p.now=y()}}catch(t){c.s.errCnt+=1,c.s.errTs=f(),c.s.p.ts=0,c.p=[],a(t)}m()})}catch(t){a(t),m()}}else!function(){if(0==c.s.chkTs)return 1;var t=new Date,e=new Date(1e3*c.s.chkTs);return e.getHours()!=t.getHours()||e.getFullYear()!=t.getFullYear()||0<c.s.fCmdTs&&c.s.fCmdTs-f(t)<0}()?l=!1:m();else p(!0)}function A(e){c.c.inv&&(o=!o);let s=0,n=0;for(let t=0;t<c.c.outs.length;t++)!function(r,t){var e="{id:"+r+",on:"+(o?"true":"false")+"}";Shelly.call("Switch.Set",e,function(t,e,s,n){0!=e&&a("error setting output "+r+" "+(o?"ON":"OFF")+": "+e+" - "+s),n(0==e)},t)}(c.c.outs[t],function(t){if(s++,t&&n++,s==c.c.outs.length)if(n==s){for(;c.h.length>=C_HIST;)c.h.splice(0,1);c.h.push([f(),o?1:0]),e(!0)}else e(!1)})}function m(){var t,e,s=new Date;r(s),o=!1;try{function n(t){o!=t&&(c.s.st=12,a("Note: command edited by user script")),o=t,A(function(t){t&&(c.s.chkTs=f()),l=!1})}0===c.c.mode?(o=1===c.c.m0.cmd,c.s.st=1):c.s.timeOK&&0<c.s.p.ts&&u(new Date(1e3*c.s.p.ts))===u(s)?(c.s.p.now=y(),1===c.c.mode?(o=c.s.p.now<=("avg"==c.c.m1.lim?c.s.p.avg:c.c.m1.lim),c.s.st=o?2:3):2===c.c.mode&&(o=function(){if(0!=c.c.m2.cn){var n=[];for(d=0;d<c.p.length;d+=c.c.m2.per){var r=[];for(ind=d;ind<d+c.c.m2.per&&!(ind>c.p.length-1);ind++)r.push(ind);if(c.c.m2.sq){let e=999,s=0;for(h=0;h<=r.length-c.c.m2.cnt;h++){let t=0;for(v=h;v<h+c.c.m2.cnt;v++)t+=c.p[r[v]][1];t/c.c.m2.cnt<e&&(e=t/c.c.m2.cnt,s=h)}for(h=s;h<s+c.c.m2.cnt;h++)n.push(r[h])}else{for(h=1;h<r.length;h++){var t=r[h];for(v=h-1;0<=v&&c.p[t][1]<c.p[r[v]][1];v--)r[v+1]=r[v];r[v+1]=t}for(h=0;h<c.c.m2.cnt;h++)n.push(r[h])}}var s=f();let e=!1;for(let t=0;t<n.length;t++)if(i(c.p[n[t]][0],s)){e=!0;break}return d=null,h=null,v=null,e}}(),c.s.st=o?5:4,!o&&c.s.p.now<=("avg"==c.c.m2.lim?c.s.p.avg:c.c.m2.lim)&&(o=!0,c.s.st=6),o)&&c.s.p.now>("avg"==c.c.m2.m?c.s.p.avg:c.c.m2.m)&&(o=!1,c.s.st=11)):c.s.timeOK?(c.s.st=7,t=1<<s.getHours(),(c.c.bk&t)==t&&(o=!0)):(o=1===c.c.err,c.s.st=8),c.s.timeOK&&(0<c.c.fh&&(e=1<<s.getHours(),(c.c.fh&e)==e)&&(o=!0,c.s.st=10),0<c.s.fCmdTs)&&(0<c.s.fCmdTs-f(s)?(o=!0,c.s.st=9):c.s.fCmdTs=0),"function"==typeof USER_OVERRIDE?USER_OVERRIDE(o,c,n):n(o)}catch(t){a(t),l=!1}}let d=0,h=0,v=0;function y(){var e=f();for(let t=0;t<c.p.length;t++)if(i(c.p[t][0],e))return c.p[t][1];throw c.p.length<24&&(c.s.p.ts=0),Error("no price for this hour")}a("shelly-porssisahko v."+c.s.v),a("URL: http://"+(Shelly.getComponentStatus("wifi").sta_ip??"192.168.33.1")+"/script/"+Shelly.getCurrentScriptId()),HTTPServer.registerEndpoint("",function(s,n){try{if(l)return s=null,n.code=503,void n.send();var r=function(t){var e={},s=t.split("&");for(let t=0;t<s.length;t++){var n=s[t].split("=");e[n[0]]=n[1]}return e}(s.query);s=null;let t="application/json",e=(n.code=200,!0);var o="text/html",i="text/javascript";"s"===r.r?(b(),n.body=JSON.stringify(c),e=!1):"r"===r.r?(p(c.s.configOK=!1),c.s.p.ts=0,n.code=204,e=!1):"f"===r.r&&r.ts?(c.s.fCmdTs=+(""+r.ts),c.s.chkTs=0,n.code=204,e=!1):r.r?"s.js"===r.r?(n.body=atob("H4sIAAAAAAAACo1W4W7bNhB+FYXrAhJmCKft/thTjbbJ1nVJM9RegaEoFkaiI9o06ZAnt4art8mb5MV2lGRHCdx2f+KY/O7uu7vvjjYKkr/fn6WEcPwYx8+bkEL6IndZuVAWxE2p/HqsjMrAeQqMn7z6PaUsfbGp+HjycnL673jyPv1I/ry7XVurAyi4u727tYTHo6BdMZNlwG9vtAWZSGNU4uVM2t3R2uhHJ0onhTQrvVhqmaA7Y+5uk4iYyXlwxsgd8n/C6qhSW5ksI7kaeLSN+UH6RVkGKC20bBMaGaClm0mOdnN0r1XuQpAs+ry7xWigjdzCawjadFF/yfncHW0RP4dEBtAPLwDKpA77oBYLZK8XeksvFhYw3gyLmoS518sdTUTPtZ85DSAl+cTPL0467Xhc++gQ/38bi2Pbyi0kRAZWA5oHkKDSldN50uevX43Tj5/4QtXNRl24pbITeZXKsLZZghLZNMiDNIXDQ0Li59evFFIC8uoo+sLQjH/WNnefhXGZRN5WFDIUKQxX0icyvQmU/ER6wIby8JBKkRUqm6s8PegzTkiaNoDsKEKEtlb5N5Pzs8ND+VlqSJZuWRqkfLK2cqGzEwmSQo+IAhYGE23tKq5W0rx2WAGNDsZZrOBEXoeUttycNU7mTWK1sttU6T7uIpRXAby21/S4txeAZ+rLxTRmxhiG3z9KL42hRACWSEydP5VZgaV7AULm+ekK0WdxlJAvJVkh7bUiHDrMQGA/rxUInbOKMY5OY4g/csSgOxrLG+pMQ6zh7prtIdHgsFU67Q/1r62ZMMpeQzHUvR5rjz7qT00TJuoLjGJV6b4bNpgqwHQ6d8FnTEChLJ2WNoulojl2i23iXwFoRB/fe7apI3jMr2K842wpPebyzuVKeLVwK/W60CbvhIv4Pdp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AAAAAAACo1SzY7TMBB+FeMDakWTihvajb1CsAf2xAFxRa49bWbr2sYzaVUh3oZn2Bfoi+E02Z8srODieOYbf983k2leuWj5mKDlnddNfwpvwkZB0M0O2AjbmkzAquN19U43jOxBfz7dZSKk0692e7prlkN2eBDMDtQe4ZBiZmFjYAis5AEdt8rBHi1U52CBARmNr8gaD+qt1I3DvbDeECmOaQjRqb9rFvChghKG8SGl4nwC2piO+nV/XoqbrlCITxTZ+ChmjRFthrVqmRNdLJe3OCD1GgWbvCl9f1uVeWz1E6RZGj0fJR6FRttmRc9i3WBIHYt+yiobh3EYkTm3ZlYVseGOyqDBbqHYHb73BKRF480KvFjHPKm/F6jOsP6C3jTL4T51UI0/4TyM6pFCv9zEP00XyjVuXjY5xR9Mvi+r1G3L8b9OB56p0+EkmzGxLgXE4uP1V3XA4OKh9tEaxhjqmHGDocZgfeeAZrJHfBuJ5fzSAwunyvJ3u6K3sBkMw7WHPlKgtKsnqRnMFyYlCO5Di94NFavojvWTbF+U4fsN9fCPvcmC1JRFDqaLPtWUrSq2r+BCXmUl30CdIXljYSb7xuVCyonmjOY/F5b+oPQYtoWwIIXAK0l89EAtAMu+vD4veC8kqS6xPMsN1wl9SYz2i836lmTZ8XHGvwHYLtlMJgQAAA=="),t=o),n.headers=[["Content-Type",t]],e&&n.headers.push(["Content-Encoding","gzip"])}catch(t){a(t),n.code=500}n.send()}),Timer.set(1e4,!0,g),g();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment