Easee Home - Interface for communication with wallbox "Easee Home"
This flow implement the cloud based API from easee to communicate with the car charger "Easee Home". The API is documented and can be find here: https://developer.easee.cloud/docs/get-started
The flow includes the importents commands:
- charger state
- ongoing charging session state
- start/stop charging
- dynamic current (can be used with photovoltaic systems) and some more
See comment "README" for start.
The flow uses . "node-red-dashboard" . "node-persist"
[{"id":"9a44c580.785ac8","type":"tab","label":"Wallbox","disabled":false,"info":""},{"id":"20f131a8.5ab6be","type":"http request","z":"9a44c580.785ac8","name":"Ongoing Charging Session State","method":"GET","ret":"txt","paytoqs":"ignore","url":"","tls":"","persist":false,"proxy":"","authType":"basic","x":620,"y":1480,"wires":[["d25ae6e2.6fb018","430c4285.17e72c"]]},{"id":"288c6b29.a78d54","type":"inject","z":"9a44c580.785ac8","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":160,"y":1480,"wires":[["fdd09084.4304b"]]},{"id":"d25ae6e2.6fb018","type":"debug","z":"9a44c580.785ac8","name":"Ongoing Charging Session State ReturnValue","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":1000,"y":1440,"wires":[]},{"id":"950f4e4e.9fa28","type":"http request","z":"9a44c580.785ac8","name":"Charger State","method":"GET","ret":"txt","paytoqs":"ignore","url":"","tls":"","persist":false,"proxy":"","authType":"basic","x":560,"y":1080,"wires":[["ff165b1e.a276e8","c1cac23a.76f8b","15f984d2.d5dd8b"]]},{"id":"19c34cb.2d526b3","type":"inject","z":"9a44c580.785ac8","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"600","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":170,"y":1080,"wires":[["c022bda5.b4686"]]},{"id":"4b2e4390.e9c6ec","type":"http request","z":"9a44c580.785ac8","name":"Start Charging","method":"POST","ret":"txt","paytoqs":"ignore","url":"","tls":"","persist":false,"proxy":"","authType":"basic","x":780,"y":1640,"wires":[["230e7f7a.359fb","9538566e.d77c08","188d06f9.1a4b49"]]},{"id":"d48c2410.45d3d8","type":"inject","z":"9a44c580.785ac8","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":160,"y":1620,"wires":[["2cfb72d1.be956e"]]},{"id":"230e7f7a.359fb","type":"debug","z":"9a44c580.785ac8","name":"StartCharing ReturnValue","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":1010,"y":1600,"wires":[]},{"id":"1229eebb.fe8e41","type":"http request","z":"9a44c580.785ac8","name":"Change Charger Settings","method":"POST","ret":"txt","paytoqs":"ignore","url":"","tls":"","persist":false,"proxy":"","authType":"basic","x":1190,"y":2200,"wires":[["7e568e8e.3053","b4a58ed1.b4592"]]},{"id":"7e568e8e.3053","type":"debug","z":"9a44c580.785ac8","name":"ChargerSettings","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":1500,"y":2160,"wires":[]},{"id":"34f10ab1.e7c836","type":"inject","z":"9a44c580.785ac8","name":"Set charging current for night","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":"","topic":"dynamicChargerCurrent","payload":"10","payloadType":"str","x":220,"y":2200,"wires":[["710ba8f2.7657a8"]]},{"id":"710ba8f2.7657a8","type":"join","z":"9a44c580.785ac8","name":"Paaring","mode":"custom","build":"object","property":"payload","propertyType":"msg","key":"topic","joiner":"\\n","joinerType":"str","accumulate":false,"timeout":"3","count":"","reduceRight":false,"reduceExp":"","reduceInit":"","reduceInitType":"num","reduceFixup":"","x":760,"y":2200,"wires":[["4f2f20a2.89fc"]]},{"id":"16d3ae36.a344c2","type":"comment","z":"9a44c580.785ac8","name":"load-balancing for each phase","info":"different current value for each phase:\nhttps://developer.easee.cloud/docs/load-balancing\n","x":220,"y":3060,"wires":[]},{"id":"c39787b5.d12cf8","type":"comment","z":"9a44c580.785ac8","name":"dynamicChargerCurrent","info":"","x":180,"y":2160,"wires":[]},{"id":"ba389cb5.ada51","type":"http request","z":"9a44c580.785ac8","name":"Set Dynamic Circuit Current","method":"POST","ret":"txt","paytoqs":"ignore","url":"https://api.easee.cloud/api/sites/288317/circuits/{circuitId}/dynamicCurrent?q={{{query}}}&format=json","tls":"","persist":false,"proxy":"","authType":"bearer","x":680,"y":3060,"wires":[["900f9602.1ef568"]]},{"id":"900f9602.1ef568","type":"debug","z":"9a44c580.785ac8","name":"","active":true,"tosidebar":true,"console":false,"complete":"payload","statusVal":"","statusType":"auto","x":970,"y":3060,"wires":[]},{"id":"c5386e6a.a19e5","type":"join","z":"9a44c580.785ac8","name":"Paaring","mode":"custom","build":"object","property":"payload","propertyType":"msg","key":"topic","joiner":"\\n","joinerType":"str","accumulate":false,"timeout":"3","count":"","reduceRight":false,"reduceExp":"","reduceInit":"","reduceInitType":"num","reduceFixup":"","x":460,"y":3060,"wires":[["ba389cb5.ada51"]]},{"id":"ff165b1e.a276e8","type":"json","z":"9a44c580.785ac8","name":"","property":"payload","action":"","pretty":false,"x":730,"y":1080,"wires":[["4f990a91.15b3d4","9227d345.f7271","a70a853d.171428","7bcee33f.fc5a9c","35c06ec8.90d622","cea19231.5ff89","67a84cfa.6009c4"]]},{"id":"4f990a91.15b3d4","type":"change","z":"9a44c580.785ac8","name":"Aktuelle Ladeleistung","rules":[{"t":"set","p":"payload","pt":"msg","to":"payload.totalPower","tot":"jsonata"}],"action":"","property":"","from":"","to":"","reg":false,"x":1040,"y":1120,"wires":[["593b49cb.7d6a68","2a930fa0.aea9a"]]},{"id":"430c4285.17e72c","type":"json","z":"9a44c580.785ac8","name":"","property":"payload","action":"","pretty":false,"x":870,"y":1480,"wires":[["e2032f68.09f44","3186b4cc.80e2ac"]]},{"id":"e2032f68.09f44","type":"change","z":"9a44c580.785ac8","name":"sessionStart","rules":[{"t":"set","p":"payload","pt":"msg","to":"payload.sessionStart","tot":"jsonata"}],"action":"","property":"","from":"","to":"","reg":false,"x":1090,"y":1480,"wires":[["123b47ac.f18a38"]]},{"id":"4b1cf7e8.e82998","type":"ui_slider","z":"9a44c580.785ac8","name":"","label":"Maximaler Ladestrom [A]","tooltip":"Begrenzung der Ladeleistung pro Phase","group":"72608c23.2d7d94","order":4,"width":0,"height":0,"passthru":false,"outs":"end","topic":"dynamicChargerCurrent","min":"6","max":"32","step":1,"x":490,"y":2240,"wires":[["710ba8f2.7657a8"]]},{"id":"f584afe5.eca3a","type":"ui_button","z":"9a44c580.785ac8","name":"","group":"72608c23.2d7d94","order":1,"width":4,"height":1,"passthru":false,"label":"Aufladen Starten","tooltip":"Freigabe Wallbox","color":"","bgcolor":"{{background}}","icon":"fa-power-off","payload":"","payloadType":"str","topic":"","x":190,"y":1660,"wires":[["21a95b1f.21aef4","2cfb72d1.be956e"]]},{"id":"31b072c1.b283de","type":"ui_button","z":"9a44c580.785ac8","name":"refresh","group":"72608c23.2d7d94","order":3,"width":1,"height":1,"passthru":true,"label":"","tooltip":"","color":"","bgcolor":"","icon":"fa-refresh","payload":"","payloadType":"str","topic":"","x":840,"y":840,"wires":[["c022bda5.b4686","fdd09084.4304b","c2a07b63.89a558"]]},{"id":"9227d345.f7271","type":"debug","z":"9a44c580.785ac8","name":"ChargerState","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":1010,"y":1080,"wires":[]},{"id":"dc5d05dd.e83f38","type":"http request","z":"9a44c580.785ac8","name":"Change Charger Commands","method":"POST","ret":"txt","paytoqs":"ignore","url":"","tls":"","persist":false,"proxy":"","authType":"basic","x":1200,"y":2500,"wires":[["c04749ab.3059f8","55b3dfac.ea836"]]},{"id":"c04749ab.3059f8","type":"debug","z":"9a44c580.785ac8","name":"CableLockState","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":1500,"y":2460,"wires":[]},{"id":"78fa2635.0bf8f8","type":"join","z":"9a44c580.785ac8","name":"Paaring","mode":"custom","build":"object","property":"payload","propertyType":"msg","key":"topic","joiner":"\\n","joinerType":"str","accumulate":false,"timeout":"3","count":"","reduceRight":false,"reduceExp":"","reduceInit":"","reduceInitType":"num","reduceFixup":"","x":760,"y":2500,"wires":[["8c42d4db.210558"]]},{"id":"60cf3ac7.102964","type":"ui_switch","z":"9a44c580.785ac8","name":"","label":"Kabelverriegelung bei Nichtbenutzung","tooltip":"Kabel ohne Ladevorgang dennoch abschließen","group":"72608c23.2d7d94","order":10,"width":0,"height":0,"passthru":false,"decouple":"true","topic":"state","style":"","onvalue":"true","onvalueType":"bool","onicon":"","oncolor":"","offvalue":"false","offvalueType":"bool","officon":"","offcolor":"","x":450,"y":2540,"wires":[["78fa2635.0bf8f8"]]},{"id":"ca43d2f4.c518","type":"comment","z":"9a44c580.785ac8","name":"https://developer.easee.cloud/reference/post_api-chargers-id-commands-lock-state","info":"","x":370,"y":2460,"wires":[]},{"id":"a70a853d.171428","type":"change","z":"9a44c580.785ac8","name":"dynamicChargerCurrent","rules":[{"t":"set","p":"payload","pt":"msg","to":"payload.dynamicChargerCurrent","tot":"jsonata"}],"action":"","property":"","from":"","to":"","reg":false,"x":1050,"y":1280,"wires":[["8c387071.928c2"]]},{"id":"8c387071.928c2","type":"link out","z":"9a44c580.785ac8","name":"","links":["38308d90.6f8dc2","a092daec.c7a748","4d3437cf.3344a8"],"x":1215,"y":1280,"wires":[]},{"id":"38308d90.6f8dc2","type":"link in","z":"9a44c580.785ac8","name":"","links":["8c387071.928c2"],"x":95,"y":2240,"wires":[["4b1cf7e8.e82998"]]},{"id":"5674779.5574688","type":"inject","z":"9a44c580.785ac8","name":"On","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"state","payload":"true","payloadType":"bool","x":150,"y":2500,"wires":[["78fa2635.0bf8f8"]]},{"id":"7bcee33f.fc5a9c","type":"change","z":"9a44c580.785ac8","name":"cableLocked","rules":[{"t":"set","p":"payload","pt":"msg","to":"payload.cableLocked","tot":"jsonata"}],"action":"","property":"","from":"","to":"","reg":false,"x":1010,"y":1320,"wires":[["d28f10ca.b71ab"]]},{"id":"d28f10ca.b71ab","type":"link out","z":"9a44c580.785ac8","name":"","links":["2cc71664.5ad52a"],"x":1215,"y":1320,"wires":[]},{"id":"2cc71664.5ad52a","type":"link in","z":"9a44c580.785ac8","name":"","links":["d28f10ca.b71ab"],"x":95,"y":2540,"wires":[["60cf3ac7.102964"]]},{"id":"593b49cb.7d6a68","type":"ui_text","z":"9a44c580.785ac8","group":"72608c23.2d7d94","order":5,"width":0,"height":0,"name":"","label":"Aktuelle Ladeleistung","format":"{{msg.payload | number: 2}} KW","layout":"row-spread","x":1440,"y":1080,"wires":[]},{"id":"123b47ac.f18a38","type":"ui_text","z":"9a44c580.785ac8","d":true,"group":"72608c23.2d7d94","order":6,"width":0,"height":0,"name":"","label":"SessionStart","format":"{{msg.payload}}","layout":"row-spread","x":1410,"y":1480,"wires":[]},{"id":"93f726c.ffdafd8","type":"ui_ui_control","z":"9a44c580.785ac8","name":"update if calling the webpage","events":"connect","x":200,"y":800,"wires":[["f0d177f6.d816a8"]]},{"id":"64351379.fbc53c","type":"link in","z":"9a44c580.785ac8","name":"","links":["1349cbbb.1d23d4","d6e41354.e4235"],"x":115,"y":1820,"wires":[["e7158462.665578"]]},{"id":"7bbd1fdf.0485e","type":"ui_text","z":"9a44c580.785ac8","group":"72608c23.2d7d94","order":7,"width":0,"height":0,"name":"","label":"Ladefreigabe","format":"{{msg.payload}}","layout":"row-spread","x":1750,"y":1740,"wires":[]},{"id":"819508be.58e858","type":"change","z":"9a44c580.785ac8","name":"unlock with HMI","rules":[{"t":"set","p":"payload","pt":"msg","to":"Button","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1280,"y":1740,"wires":[["7bbd1fdf.0485e"]]},{"id":"2a930fa0.aea9a","type":"ui_chart","z":"9a44c580.785ac8","name":"","group":"a80bce66.cb5dc","order":11,"width":0,"height":0,"label":"Ladeleistung [KW]","chartType":"line","legend":"false","xformat":"HH:mm:ss","interpolate":"step","nodata":"","dot":false,"ymin":"","ymax":"","removeOlder":"5","removeOlderPoints":"","removeOlderUnit":"3600","cutout":0,"useOneColor":false,"useUTC":false,"colors":["#1f77b4","#aec7e8","#ff7f0e","#2ca02c","#98df8a","#d62728","#ff9896","#9467bd","#c5b0d5"],"useOldStyle":false,"outputs":1,"x":1430,"y":1120,"wires":[[]]},{"id":"e648d7a2.17fdf8","type":"ui_text","z":"9a44c580.785ac8","group":"72608c23.2d7d94","order":8,"width":0,"height":0,"name":"","label":"Status","format":"{{msg.payload}}","layout":"row-spread","x":1390,"y":1160,"wires":[]},{"id":"35c06ec8.90d622","type":"change","z":"9a44c580.785ac8","name":"chargerOpMode","rules":[{"t":"set","p":"payload","pt":"msg","to":"payload.chargerOpMode","tot":"jsonata"}],"action":"","property":"","from":"","to":"","reg":false,"x":1020,"y":1160,"wires":[["90a2a8a2.a88fb8","73ae9109.4cc06","caa36abd.a49b18"]]},{"id":"90a2a8a2.a88fb8","type":"function","z":"9a44c580.785ac8","name":"ToString","func":"//https://developer.easee.cloud/discuss/624ea91c8a961808d1172149\n\nlet values = {\"0\":\"Offline\",\n \"1\": \"Disconnected\",\n \"2\": \"AwaitingStart\", //Warten auf Genehmigung\n \"3\": \"Charging\",\n \"4\": \"Completed\", \n \"5\": \"Error\",\n \"6\": \"ReadyToCharge\"}\nlet chargeState = msg.payload.toString();\nif ( Object.keys(values).includes(chargeState)){\n msg.payload = values[chargeState];\n}\nelse{\n msg.payload = msg.payload.ChargeState;\n}\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":1260,"y":1160,"wires":[["e648d7a2.17fdf8"]]},{"id":"76d1c5dd.0112dc","type":"comment","z":"9a44c580.785ac8","name":"SmartCharing = blue Light","info":"SmartCharing aktiviert die blaue LED. Leuchtet nur bei angeschlossenem Auto.\n\nhttps://developer.easee.cloud/discuss/620bad99d6086900a848838c\n\n\n","x":190,"y":2300,"wires":[]},{"id":"db167e2f.d40d8","type":"http request","z":"9a44c580.785ac8","name":"Change Charger Settings","method":"POST","ret":"txt","paytoqs":"ignore","url":"","tls":"","persist":false,"proxy":"","authType":"basic","x":1190,"y":2740,"wires":[["d48a3f0b.6fe5a"]]},{"id":"d48a3f0b.6fe5a","type":"debug","z":"9a44c580.785ac8","name":"AccessControl","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":1500,"y":2740,"wires":[]},{"id":"94905336.839b8","type":"inject","z":"9a44c580.785ac8","name":"NOT: Set to allow charging for any tag when offline (user must still present a tag).","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":"","topic":"allowOfflineTxForUnknownId","payload":"false","payloadType":"bool","x":400,"y":2740,"wires":[["ddd2213b.b3083"]]},{"id":"ddd2213b.b3083","type":"join","z":"9a44c580.785ac8","name":"Paaring","mode":"custom","build":"object","property":"payload","propertyType":"msg","key":"topic","joiner":"\\n","joinerType":"str","accumulate":false,"timeout":"3","count":"","reduceRight":false,"reduceExp":"","reduceInit":"","reduceInitType":"num","reduceFixup":"","x":760,"y":2740,"wires":[["3980a087.ea6c8"]]},{"id":"e684c8f.45cbd38","type":"comment","z":"9a44c580.785ac8","name":"Zugang nur mit Berechtigung (auch wenn Wallbox offline)- https://developer.easee.cloud/docs/settings","info":"","x":450,"y":2700,"wires":[]},{"id":"708ee042.4b75f","type":"http request","z":"9a44c580.785ac8","name":"Charger Config","method":"GET","ret":"txt","paytoqs":"ignore","url":"","tls":"","persist":false,"proxy":"","authType":"basic","x":1160,"y":2820,"wires":[["7ac45031.8c926","13fcffa5.33af8"]]},{"id":"3bfdd2e7.a57dae","type":"inject","z":"9a44c580.785ac8","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":180,"y":2820,"wires":[["fb9e046a.8c3bc8"]]},{"id":"7ac45031.8c926","type":"debug","z":"9a44c580.785ac8","name":"ChargerConfig","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":1500,"y":2820,"wires":[]},{"id":"f0ef63ba.fdcc7","type":"comment","z":"9a44c580.785ac8","name":"Einstellungen - Schreiben + Lesen","info":"","x":220,"y":2660,"wires":[]},{"id":"64013dcc.163d34","type":"link in","z":"9a44c580.785ac8","name":"","links":["b4a58ed1.b4592","9538566e.d77c08","55b3dfac.ea836","8686ea07.ecbac8"],"x":95,"y":840,"wires":[["6e7210c6.fc5d"]]},{"id":"b4a58ed1.b4592","type":"link out","z":"9a44c580.785ac8","name":"","links":["64013dcc.163d34","16abd38d.0765fc"],"x":1435,"y":2200,"wires":[]},{"id":"9538566e.d77c08","type":"link out","z":"9a44c580.785ac8","name":"","links":["64013dcc.163d34","16abd38d.0765fc"],"x":915,"y":1640,"wires":[]},{"id":"55b3dfac.ea836","type":"link out","z":"9a44c580.785ac8","name":"","links":["64013dcc.163d34","16abd38d.0765fc"],"x":1435,"y":2500,"wires":[]},{"id":"6e7210c6.fc5d","type":"delay","z":"9a44c580.785ac8","name":"Update webpage","pauseType":"delay","timeout":"1","timeoutUnits":"seconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":230,"y":840,"wires":[["f0d177f6.d816a8"]]},{"id":"73ae9109.4cc06","type":"change","z":"9a44c580.785ac8","name":"Save state chargerOpMode","rules":[{"t":"move","p":"payload","pt":"msg","to":"chargerOpMode","tot":"flow"}],"action":"","property":"","from":"","to":"","reg":false,"x":1320,"y":1200,"wires":[[]]},{"id":"54f7cb85.164d14","type":"switch","z":"9a44c580.785ac8","name":"authorization necessary?","property":"chargerOpMode","propertyType":"flow","rules":[{"t":"eq","v":"2","vt":"num"}],"checkall":"true","repair":false,"outputs":1,"x":1010,"y":1820,"wires":[["2cfb72d1.be956e","1423bbc.accfc44"]]},{"id":"caa36abd.a49b18","type":"switch","z":"9a44c580.785ac8","name":"Disconnected?","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"1","vt":"str"}],"checkall":"true","repair":false,"outputs":1,"x":1360,"y":1580,"wires":[["deba938.957347"]]},{"id":"21a95b1f.21aef4","type":"switch","z":"9a44c580.785ac8","name":"authorization necessary?","property":"chargerOpMode","propertyType":"flow","rules":[{"t":"eq","v":"2","vt":"num"}],"checkall":"true","repair":false,"outputs":1,"x":1010,"y":1740,"wires":[["819508be.58e858","2cfb72d1.be956e"]]},{"id":"cea19231.5ff89","type":"change","z":"9a44c580.785ac8","name":"reasonForNoCurrent","rules":[{"t":"set","p":"payload","pt":"msg","to":"payload.reasonForNoCurrent","tot":"jsonata"}],"action":"","property":"","from":"","to":"","reg":false,"x":1040,"y":1240,"wires":[["fe8ac627.3a4038"]]},{"id":"fe8ac627.3a4038","type":"function","z":"9a44c580.785ac8","name":"ToString","func":"//https://github.com/fondberg/easee_hass/blob/master/custom_components/easee/const.py\n//https://developer.easee.cloud/docs/enumerations\n\nlet values = {\n \"0\": \"RNC_OK\",\n \"1\": \"RNC_MAX_CIRCUIT_CURRENT_TOO_LOW\",\n \"2\": \"RNC_MAX_DYNAMIC_CIRCUIT_CURRENT_TOO_LOW\",\n \"3\": \"RNC_MAX_DYNAMIC_OFFLINE_FALLBACK_CURRENT_TOO_LOW\",\n \"4\": \"RNC_CIRCUIT_FUSE_TOO_LOW\",\n \"5\": \"RNC_WAITING_IN_QUEUE\",\n \"6\": \"RNC_WAITING_IN_FULLY\",\n \"7\": \"RNC_ILLEGAL_GRID_TYPE\",\n \"8\": \"RNC_NO_CURRENT_REQUEST_RECEIVED\",\n \"9\": \"RNC_NOT_CONNECTED_TO_MASTER\",\n \"10\": \"RNC_CURRENT_FROM_EQ_TOO_LOW\",\n \"11\": \"RNC_PHASE_NOT_CONNECTED\",\n \"25\": \"RNC_LIMITED_BY_CIRCUIT_FUSE\",\n \"26\": \"RNC_LIMITED_BY_CIRCUIT_MAX_LIMIT\",\n \"27\": \"RNC_LIMITED_BY_CIRCUIT_DYNAMIC_LIMIT\",\n \"28\": \"RNC_LIMITED_BY_EQUALIZER\",\n \"29\": \"RNC_LIMITED_BY_LOAD_BALANCING\",\n \"30\": \"RNC_LIMITED_BY_OFFLINE_SETTING\",\n \"50\": \"RNC_NOT_REQUESTING\",\n \"51\": \"RNC_MAX_CHARGER_CURRENT_TOO_LOW\",\n \"52\": \"RNC_MAX_DYNAMIC_CHARGER_CURRENT_TOO_LOW\",\n \"53\": \"RNC_CHARGER_DISABLED\",\n \"54\": \"RNC_PENDING_SCHEDULE\",\n \"55\": \"RNC_PENDING_AUTHORIZATION\",\n \"56\": \"RNC_CHARGER_IN_ERROR_STATE\",\n \"57\": \"RNC_ERRATIC_EV\",\n \"75\": \"RNC_LIMITED_BY_CABLE_RATING\",\n \"76\": \"RNC_LIMITED_BY_SCHEDULE\",\n \"77\": \"RNC_LIMITED_BY_CHARGER_MAX_LIMIT\",\n \"78\": \"RNC_LIMITED_BY_CHARGER_DYNAMIC_LIMIT\",\n \"79\": \"RNC_CAR_NOT_CHARGING\",\n \"80\": \"RNC_LIMITED_BY_LOCAL_ADJUSTMENT\",\n \"81\": \"RNC_LIMITED_BY_CAR\",\n \"100\": \"RNC_UNDEFINED\"}\n\nlet RNC = msg.payload.toString();\nif ( Object.keys(values).includes(RNC)){\n msg.payload = values[RNC];\n}\nelse{\n msg.payload = msg.payload.reasonForNoCurrent;\n}\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":1260,"y":1240,"wires":[["8521b36a.90dcf"]]},{"id":"8521b36a.90dcf","type":"ui_text","z":"9a44c580.785ac8","group":"a80bce66.cb5dc","order":12,"width":0,"height":0,"name":"","label":"Reason no current","format":"{{msg.payload}}","layout":"col-center","x":1430,"y":1240,"wires":[]},{"id":"deba938.957347","type":"change","z":"9a44c580.785ac8","name":"(leer)","rules":[{"t":"set","p":"payload","pt":"msg","to":"-","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1530,"y":1580,"wires":[["7bbd1fdf.0485e"]]},{"id":"fd9179da.a47558","type":"comment","z":"9a44c580.785ac8","name":"tbd","info":"","x":130,"y":3020,"wires":[]},{"id":"c2a07b63.89a558","type":"link out","z":"9a44c580.785ac8","name":"","links":["aeb4cb9a.216ab8"],"x":1035,"y":840,"wires":[]},{"id":"d69c8330.563c3","type":"comment","z":"9a44c580.785ac8","name":"Update WLAN-devices","info":"","x":1120,"y":800,"wires":[]},{"id":"2cf554df.7a80cc","type":"http request","z":"9a44c580.785ac8","name":"Start/Stop","method":"POST","ret":"txt","paytoqs":"ignore","url":"","tls":"","persist":false,"proxy":"","authType":"basic","x":800,"y":1980,"wires":[["5794343a.008f4c","8686ea07.ecbac8","fec86ad3.22d398"]]},{"id":"5794343a.008f4c","type":"debug","z":"9a44c580.785ac8","name":"Start/Stop ReturnValue","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":1060,"y":1940,"wires":[]},{"id":"e89c1a54.019868","type":"inject","z":"9a44c580.785ac8","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":160,"y":1940,"wires":[["aa2d1b39.409ed8"]]},{"id":"80fdb59c.dde44","type":"inject","z":"9a44c580.785ac8","name":"set accessToken (once or if invalid)","props":[{"p":"payload"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"eyJhbGciOiJIUzI1NiIsInRCI6IkpXVCJ9.eyJBY2NvdW50SWQiOjIxMTI2NywiVXNlcklkIjoxODExMDgsInVuaXF1ZV9uYW1lIjoiTW9yaXR6IEvDtnNsZXIiLCJyb2xlIjoiVXNlciIsIm5iZiI6MTY1ODkwMTQwNywiZXhwIjoxNjU4OTg3ODA3LCJpYXQiOjE2NTg5MDE0MDd9.KDs3-VbE2TeggFcn7RDJS1kBR0oVJp1dcdCIid9E2i4","payloadType":"str","x":240,"y":140,"wires":[["2a1739a7.cd1b66"]]},{"id":"ac0ef7ad.1a1b28","type":"comment","z":"9a44c580.785ac8","name":"Readme","info":"1) Mit Benutzernamen und PW Token generieren (https://developer.easee.cloud/reference/post_api-accounts-login)\n2) AccessToken und RefreshToken in NodeRed eintragen. flow ausführen\n3) ChargerID in NodeRed eintragen. flow ausführen\n4) Fertig\n\nOptional:\nEinstellungen - Schreiben + Lesen\n\nInfo:\ntoken handling - https://developer.easee.cloud/reference/post_api-accounts-refresh-token\n\n","x":130,"y":100,"wires":[]},{"id":"c022bda5.b4686","type":"function","z":"9a44c580.785ac8","name":"Header + URL","func":"let token = flow.get('token');\nlet ChargerID = flow.get('ChargerID');\n\nmsg.headers = {\n 'Authorization': 'Bearer ' + token\n};\n\nmsg.url = 'https://api.easee.cloud/api/chargers/' + ChargerID + '/state'\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":360,"y":1080,"wires":[["950f4e4e.9fa28"]]},{"id":"c1cac23a.76f8b","type":"debug","z":"9a44c580.785ac8","name":"ChargerStateReturnValue","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":790,"y":1020,"wires":[]},{"id":"2cfb72d1.be956e","type":"function","z":"9a44c580.785ac8","name":"Header + URL","func":"let token = flow.get('token');\nlet ChargerID = flow.get('ChargerID');\n\nmsg.headers = {\n 'Authorization': 'Bearer ' + token\n};\n\nmsg.url = 'https://api.easee.cloud/api/chargers/' + ChargerID + '/commands/start_charging'\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":580,"y":1640,"wires":[["4b2e4390.e9c6ec"]]},{"id":"cd811a9c.389e68","type":"inject","z":"9a44c580.785ac8","name":"Refresh tokens (max 24h)","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"36000","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":220,"y":260,"wires":[["89d23602.8a4638"]]},{"id":"d76a5043.f79e6","type":"http request","z":"9a44c580.785ac8","name":"","method":"POST","ret":"txt","paytoqs":"ignore","url":"https://api.easee.cloud/api/accounts/refresh_token","tls":"","persist":false,"proxy":"","authType":"basic","x":890,"y":260,"wires":[["fa9923f2.62bc9","7944d4e9.5d792c","3cd561a0.18c50e"]]},{"id":"1b110917.2d55d7","type":"function","z":"9a44c580.785ac8","name":"Token -> Header","func":"let token = flow.get('token');\n\nmsg.headers = {\n 'Authorization': 'Bearer ' + token\n};\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":710,"y":260,"wires":[["d76a5043.f79e6"]]},{"id":"fa9923f2.62bc9","type":"debug","z":"9a44c580.785ac8","name":"Output RefreshToken","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":1120,"y":160,"wires":[]},{"id":"89d23602.8a4638","type":"function","z":"9a44c580.785ac8","name":"set BODY PARAMS","func":"\nlet token = flow.get('token');\nlet refreshToken = flow.get('refreshToken');\n\nmsg.payload = {\n 'accessToken': token,\n 'refreshToken': refreshToken\n};\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":500,"y":260,"wires":[["1b110917.2d55d7"]]},{"id":"8c42d4db.210558","type":"function","z":"9a44c580.785ac8","name":"Token -> Header","func":"let token = flow.get('token');\nlet ChargerID = flow.get('ChargerID');\n\nmsg.headers = {\n 'Authorization': 'Bearer ' + token\n};\n\nmsg.url = 'https://api.easee.cloud/api/chargers/' + ChargerID + '/commands/lock_state?q={{{query}}}&format=json'\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":950,"y":2500,"wires":[["dc5d05dd.e83f38"]]},{"id":"3980a087.ea6c8","type":"function","z":"9a44c580.785ac8","name":"Token -> Header","func":"let token = flow.get('token');\nlet ChargerID = flow.get('ChargerID');\n\nmsg.headers = {\n 'Authorization': 'Bearer ' + token\n};\n\nmsg.url = 'https://api.easee.cloud/api/chargers/' + ChargerID + '/settings?q={{{query}}}&format=json'\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":950,"y":2740,"wires":[["db167e2f.d40d8"]]},{"id":"15f984d2.d5dd8b","type":"function","z":"9a44c580.785ac8","name":"Empfangsuhrzeit speichern","func":"var dtLastRX = Date.now();\nflow.set(\"dtLastRX\", dtLastRX);\nmsg.payload = dtLastRX;\n\nreturn msg;\n\n\n","outputs":1,"noerr":0,"initialize":"","finalize":"","x":1060,"y":1040,"wires":[["b2a67e2.d4d958"]]},{"id":"b2a67e2.d4d958","type":"ui_text","z":"9a44c580.785ac8","group":"72608c23.2d7d94","order":13,"width":0,"height":0,"name":"","label":"Letzte Aktualisierung um","format":"{{msg.payload | date:\"dd.MM. HH:mm\"}} Uhr","layout":"row-spread","x":1450,"y":1040,"wires":[]},{"id":"7644be5c.2d767","type":"ui_button","z":"9a44c580.785ac8","name":"Start/Stop","group":"72608c23.2d7d94","order":2,"width":2,"height":1,"passthru":false,"label":"Start/Stop","tooltip":"Toggle","color":"","bgcolor":"{{background}}","icon":"","payload":"","payloadType":"str","topic":"","x":160,"y":1980,"wires":[["aa2d1b39.409ed8"]]},{"id":"1423bbc.accfc44","type":"change","z":"9a44c580.785ac8","name":"Feigabe Handy (Anwesenheit im WLAN, nicht VPN)","rules":[{"t":"set","p":"topic","pt":"msg","to":"hostname","tot":"str"},{"t":"set","p":"payload","pt":"msg","to":"payload.hostname","tot":"jsonata"}],"action":"","property":"","from":"","to":"","reg":false,"x":1390,"y":1820,"wires":[["7bbd1fdf.0485e"]]},{"id":"8686ea07.ecbac8","type":"link out","z":"9a44c580.785ac8","name":"","links":["64013dcc.163d34","16abd38d.0765fc"],"x":975,"y":1980,"wires":[]},{"id":"e7158462.665578","type":"switch","z":"9a44c580.785ac8","name":"authorization with WifiDevices?","property":"EnableWifiDevices","propertyType":"flow","rules":[{"t":"true"}],"checkall":"true","repair":false,"outputs":1,"x":290,"y":1820,"wires":[["bcaf8d.4e19e07"]]},{"id":"baacdc69.8eb8b","type":"ui_switch","z":"9a44c580.785ac8","name":"WLAN Geräte","label":"Ladefreigabe über Geräte im WLAN erlauben","tooltip":"Ausgewählte Geräte starten den Ladevorgang automatisch wenn diese im WLAN eingeloggt sind","group":"72608c23.2d7d94","order":9,"width":0,"height":0,"passthru":true,"decouple":"false","topic":"EnableWifiDevices","style":"","onvalue":"true","onvalueType":"bool","onicon":"","oncolor":"","offvalue":"false","offvalueType":"bool","officon":"","offcolor":"","x":180,"y":1760,"wires":[["629f547e.e9a5ac"]]},{"id":"629f547e.e9a5ac","type":"change","z":"9a44c580.785ac8","name":"set EnableWifiDevices","rules":[{"t":"set","p":"EnableWifiDevices","pt":"flow","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":400,"y":1760,"wires":[[]]},{"id":"ab247a06.75f0e8","type":"change","z":"9a44c580.785ac8","name":"refreshToken","rules":[{"t":"set","p":"payload","pt":"msg","to":"payload.refreshToken","tot":"jsonata"}],"action":"","property":"","from":"","to":"","reg":false,"x":1370,"y":300,"wires":[["242fc03a.87ab7","93379e9.95a736"]]},{"id":"4a3214c0.c6c17c","type":"debug","z":"9a44c580.785ac8","name":"refreshToken","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":1750,"y":300,"wires":[]},{"id":"242fc03a.87ab7","type":"change","z":"9a44c580.785ac8","name":"save refreshToken","rules":[{"t":"set","p":"refreshToken","pt":"flow","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":1570,"y":300,"wires":[["4a3214c0.c6c17c"]]},{"id":"70ad1dae.6890b4","type":"change","z":"9a44c580.785ac8","name":"accessToken","rules":[{"t":"set","p":"payload","pt":"msg","to":"payload.accessToken","tot":"jsonata"}],"action":"","property":"","from":"","to":"","reg":false,"x":1370,"y":260,"wires":[["2a1739a7.cd1b66"]]},{"id":"2a1739a7.cd1b66","type":"change","z":"9a44c580.785ac8","name":"save accessToken","rules":[{"t":"set","p":"token","pt":"flow","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":1570,"y":260,"wires":[["c6decdc6.49573"]]},{"id":"c6decdc6.49573","type":"debug","z":"9a44c580.785ac8","name":"accessToken","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":1750,"y":260,"wires":[]},{"id":"19002248.4a5b2e","type":"inject","z":"9a44c580.785ac8","name":"setze refreshToken (once or if invalid)","props":[{"p":"payload"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"mgLYMSgMHBWbDf+eMK7MXIqkmkbZk0M5KKb5he1YI=","payloadType":"str","x":250,"y":180,"wires":[["242fc03a.87ab7"]]},{"id":"7944d4e9.5d792c","type":"json","z":"9a44c580.785ac8","name":"","property":"payload","action":"","pretty":false,"x":1070,"y":260,"wires":[["70ad1dae.6890b4","ab247a06.75f0e8"]]},{"id":"93379e9.95a736","type":"function","z":"9a44c580.785ac8","name":"Empfangsuhrzeit speichern","func":"var dtLastRX_Token = Date.now();\nflow.set(\"dtLastRX_Token\", dtLastRX_Token);\nmsg.payload = dtLastRX_Token;\n\nreturn msg;\n\n\n","outputs":1,"noerr":0,"initialize":"","finalize":"","x":1480,"y":360,"wires":[["5826afb9.d7483"]]},{"id":"5826afb9.d7483","type":"ui_text","z":"9a44c580.785ac8","group":"a80bce66.cb5dc","order":14,"width":0,"height":0,"name":"","label":"Letztes Token-Update","format":"{{msg.payload | date:\"dd.MM. HH:mm\"}} Uhr","layout":"row-spread","x":1740,"y":360,"wires":[]},{"id":"302cfd42.00b702","type":"inject","z":"9a44c580.785ac8","name":"setze Charger ID","props":[{"p":"payload"}],"repeat":"","crontab":"","once":true,"onceDelay":0.1,"topic":"","payload":"EH2SEGQ5","payloadType":"str","x":190,"y":500,"wires":[["ff1a4c3e.cd3d"]]},{"id":"ff1a4c3e.cd3d","type":"change","z":"9a44c580.785ac8","name":"","rules":[{"t":"set","p":"ChargerID","pt":"flow","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":730,"y":500,"wires":[["de093022.a1c4c"]]},{"id":"de093022.a1c4c","type":"debug","z":"9a44c580.785ac8","name":"saved ChargerID","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":1630,"y":500,"wires":[]},{"id":"fdd09084.4304b","type":"function","z":"9a44c580.785ac8","name":"Header + URL","func":"let token = flow.get('token');\nlet ChargerID = flow.get('ChargerID');\n\nmsg.headers = {\n 'Authorization': 'Bearer ' + token\n};\n\nmsg.url = 'https://api.easee.cloud/api/chargers/' + ChargerID + '/sessions/ongoing'\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":360,"y":1480,"wires":[["20f131a8.5ab6be"]]},{"id":"aa2d1b39.409ed8","type":"function","z":"9a44c580.785ac8","name":"Header + URL","func":"let token = flow.get('token');\nlet ChargerID = flow.get('ChargerID');\n\nmsg.headers = {\n 'Authorization': 'Bearer ' + token\n};\n\nmsg.url = 'https://api.easee.cloud/api/chargers/' + ChargerID + '/commands/toggle_charging'\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":560,"y":1980,"wires":[["2cf554df.7a80cc"]]},{"id":"4f2f20a2.89fc","type":"function","z":"9a44c580.785ac8","name":"Header + URL","func":"let token = flow.get('token');\nlet ChargerID = flow.get('ChargerID');\n\nmsg.headers = {\n 'Authorization': 'Bearer ' + token\n};\n\nmsg.url = 'https://api.easee.cloud/api/chargers/' + ChargerID + '/settings?q={{{query}}}&format=json'\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":940,"y":2200,"wires":[["1229eebb.fe8e41"]]},{"id":"3186b4cc.80e2ac","type":"change","z":"9a44c580.785ac8","name":"sessionEnergy","rules":[{"t":"set","p":"payload","pt":"msg","to":"payload.sessionEnergy","tot":"jsonata"}],"action":"","property":"","from":"","to":"","reg":false,"x":1100,"y":1520,"wires":[["26fdd860.a64e38"]]},{"id":"26fdd860.a64e38","type":"ui_text","z":"9a44c580.785ac8","d":true,"group":"a80bce66.cb5dc","order":6,"width":0,"height":0,"name":"","label":"SessionEnergie","format":"{{msg.payload | number: 2}} KW/h","layout":"row-spread","x":1420,"y":1520,"wires":[]},{"id":"188d06f9.1a4b49","type":"function","z":"9a44c580.785ac8","name":"Change BackgroundColour","func":"var nReturnValue = parseInt(msg.statusCode);\n\nif (nReturnValue < 400){\n //successful\n msg.background = \"rgb()\";\n}\nelse{\n //Error\n msg.background = \"rgb(219, 60, 48)\";\n //see msg.headers.x-amzn-remapped-www-authenticate;\n}\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":1020,"y":1680,"wires":[["f584afe5.eca3a"]]},{"id":"fec86ad3.22d398","type":"function","z":"9a44c580.785ac8","name":"Change BackgroundColour","func":"var nReturnValue = parseInt(msg.statusCode);\n\nif (nReturnValue < 400){\n //successful\n msg.background = \"rgb()\";\n}\nelse{\n //Error\n msg.background = \"rgb(219, 60, 48)\";\n}\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":1080,"y":2020,"wires":[["7644be5c.2d767"]]},{"id":"63c435f.037c8cc","type":"comment","z":"9a44c580.785ac8","name":"Get currently used RFID key","info":"https://developer.easee.cloud/discuss/624e8cba912b4000894e0766\nYou can get the RFID key with the observations endpoint\nhttps://developer.easee.cloud/reference/get_api-chargers-id-observations-observationid-from-to\n\nTo get the RFID key use observationId 128. However, you will need to know when the user scanned the key.\n\n\nhttps://developer.easee.cloud/reference/get_api-chargers-id-observations-observationid-from-to\n\npossible values\nhttps://api.easee.cloud/api/resources/observation_properties\n\n\n\n\n","x":220,"y":3120,"wires":[]},{"id":"869bceb5.6bbef","type":"ui_switch","z":"9a44c580.785ac8","name":"","label":"SmartCharging","tooltip":"blaue LED","group":"a80bce66.cb5dc","order":10,"width":0,"height":0,"passthru":false,"decouple":"true","topic":"smartCharging","style":"","onvalue":"true","onvalueType":"bool","onicon":"","oncolor":"","offvalue":"false","offvalueType":"bool","officon":"","offcolor":"","x":460,"y":2340,"wires":[["710ba8f2.7657a8"]]},{"id":"67a84cfa.6009c4","type":"change","z":"9a44c580.785ac8","name":"smartCharging","rules":[{"t":"set","p":"payload","pt":"msg","to":"payload.smartCharging","tot":"jsonata"}],"action":"","property":"","from":"","to":"","reg":false,"x":1020,"y":1360,"wires":[["2cc0bc30.908fe4"]]},{"id":"be2d0fc0.77c72","type":"link in","z":"9a44c580.785ac8","name":"","links":["2cc0bc30.908fe4"],"x":95,"y":2340,"wires":[["869bceb5.6bbef"]]},{"id":"2cc0bc30.908fe4","type":"link out","z":"9a44c580.785ac8","name":"","links":["be2d0fc0.77c72"],"x":1215,"y":1360,"wires":[]},{"id":"fb9e046a.8c3bc8","type":"function","z":"9a44c580.785ac8","name":"Token -> Header","func":"let token = flow.get('token');\nlet ChargerID = flow.get('ChargerID');\n\nmsg.headers = {\n 'Authorization': 'Bearer ' + token\n};\n\nmsg.url = 'https://api.easee.cloud/api/chargers/' + ChargerID + '/config'\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":950,"y":2820,"wires":[["708ee042.4b75f"]]},{"id":"77735c7.b6932a4","type":"trigger","z":"9a44c580.785ac8","name":"","op1":"","op2":"0","op1type":"pay","op2type":"str","duration":"4","extend":false,"overrideDelay":false,"units":"s","reset":"","bytopic":"all","topic":"topic","outputs":1,"x":660,"y":880,"wires":[["31b072c1.b283de"]]},{"id":"f0d177f6.d816a8","type":"delay","z":"9a44c580.785ac8","name":"bandwith limit","pauseType":"rate","timeout":"5","timeoutUnits":"seconds","rate":"2","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":true,"x":480,"y":840,"wires":[["77735c7.b6932a4","31b072c1.b283de"]]},{"id":"13fcffa5.33af8","type":"function","z":"9a44c580.785ac8","name":"ErrorHandling","func":"var nReturnValue = parseInt(msg.statusCode);\nvar header = msg.headers;\n\nif (nReturnValue < 400){\n //successful\n msg.background = \"rgb()\";\n //see msg.headers['x-amzn-remapped-connection'];\n}\nelse{\n //Error\n msg.background = \"rgb(219, 60, 48)\";\n //see msg.headers['x-amzn-remapped-www-authenticate'];\n}\n\nmsg.payload = header;\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":1380,"y":2860,"wires":[[]]},{"id":"bcaf8d.4e19e07","type":"delay","z":"9a44c580.785ac8","name":"prevent to mutch requestes if charger is not reachable","pauseType":"rate","timeout":"5","timeoutUnits":"seconds","rate":"2","nbRateUnits":"5","rateUnits":"minute","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":true,"x":660,"y":1820,"wires":[["54f7cb85.164d14"]]},{"id":"3cd561a0.18c50e","type":"persist in","z":"9a44c580.785ac8","name":"TokenPerist","storageNode":"10de4a4.ce150b6","x":1090,"y":340,"wires":[]},{"id":"abf65ae6.f64628","type":"persist out","z":"9a44c580.785ac8","name":"TokenPerist","storageNode":"10de4a4.ce150b6","x":870,"y":340,"wires":[["7944d4e9.5d792c","62d18e59.a29f1"]]},{"id":"5a08fda2.dba734","type":"inject","z":"9a44c580.785ac8","name":"Restore","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":670,"y":340,"wires":[["abf65ae6.f64628"]]},{"id":"62d18e59.a29f1","type":"debug","z":"9a44c580.785ac8","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":1090,"y":420,"wires":[]},{"id":"72608c23.2d7d94","type":"ui_group","name":"Wallbox","tab":"498e482e.7d9758","order":1,"disp":false,"width":"7","collapse":false},{"id":"a80bce66.cb5dc","type":"ui_group","name":"Experte","tab":"498e482e.7d9758","order":2,"disp":true,"width":"7","collapse":true},{"id":"10de4a4.ce150b6","type":"persist-store","filename":"persistenceCar.json","interval":"600"},{"id":"498e482e.7d9758","type":"ui_tab","name":"Wallbox","icon":"fa-car","disabled":false,"hidden":false}]