-
Notifications
You must be signed in to change notification settings - Fork 0
/
NodeRed Resistor Flow.json
1 lines (1 loc) · 8.1 KB
/
NodeRed Resistor Flow.json
1
[{"id":"18c9e5a0be408c48","type":"function","z":"5c6241124b106109","name":"Temp -> DigiPot","func":"//Begärd Temp in : Resistor Mode ut\nvar loc = {\n \"25.0\" : 5,\n \"24.0\" : 5,\n \"23.0\" : 5,\n \"22.0\" : 6,\n \"21.0\" : 6,\n \"20.0\" : 6,\n \"19.0\" : 6,\n \"18.0\" : 7,\n \"17.0\" : 7,\n \"16.0\" : 7,\n \"15.0\" : 8,\n \"14.0\" : 8,\n \"13.0\" : 8,\n \"12.0\" : 9,\n \"11.0\" : 9,\n \"10.0\" : 10,\n \"9.0\" : 10,\n \"8.0\" : 11,\n \"7.0\" : 11,\n \"6.0\" : 12,\n \"5.0\" : 12,\n \"4.0\" : 13,\n \"3.0\" : 14,\n \"2.0\" : 14,\n \"1.0\" : 15,\n \"0.0\" : 16,\n \"-1.0\": 18,\n \"-2.0\": 19,\n \"-3.0\": 20,\n \"-4.0\": 21,\n \"-5.0\": 22,\n \"-6.0\": 23,\n \"-7.0\": 24,\n \"-8.0\": 25,\n \"-9.0\": 27,\n \"-10.0\": 28,\n \"-11.0\": 30,\n \"-12.0\": 31,\n \"-13.0\": 33,\n \"-14.0\": 35,\n \"-15.0\": 37,\n \"-16.0\": 39,\n \"-17.0\": 41,\n \"-18.0\": 44,\n \"-19.0\": 47,\n \"-20.0\": 49,\n \"-21.0\": 52,\n \"-22.0\": 55,\n \"-23.0\": 58,\n \"-24.0\": 61,\n \"-25.0\": 64,\n \"-26.0\": 68,\n \"-27.0\": 72,\n \"-28.0\": 76,\n \"-29.0\": 81,\n \"-30.0\": 86\n};\n\nmsg.payload = loc[msg.payload];\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":360,"y":1970,"wires":[["935f1c5876465932","85cc893866841265"]]},{"id":"85cc893866841265","type":"api-call-service","z":"5c6241124b106109","name":"Set DigiPot","server":"e3faae9c.59214","version":5,"debugenabled":false,"domain":"number","service":"set_value","areaId":[],"deviceId":[],"entityId":["number.digipot_level"],"data":"{\"value\":msg.payload}","dataType":"jsonata","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":560,"y":1970,"wires":[[]]},{"id":"663465a71416050c","type":"server-state-changed","z":"5c6241124b106109","name":"Sätt Framledn.","server":"e3faae9c.59214","version":4,"exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"entityidfilter":"input_number.bestam_framledningstemp","entityidfiltertype":"exact","outputinitially":false,"state_type":"str","haltifstate":"","halt_if_type":"str","halt_if_compare":"is","outputs":1,"output_only_on_state_change":true,"for":"0","forType":"num","forUnits":"minutes","ignorePrevStateNull":false,"ignorePrevStateUnknown":false,"ignorePrevStateUnavailable":false,"ignoreCurrentStateUnknown":false,"ignoreCurrentStateUnavailable":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"eventData"},{"property":"topic","propertyType":"msg","value":"","valueType":"triggerId"}],"x":180,"y":2030,"wires":[["d81809ff2278c53b"]]},{"id":"b45be7163f392b26","type":"server-state-changed","z":"5c6241124b106109","name":"Sätt Utetemp","server":"e3faae9c.59214","version":4,"exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"entityidfilter":"input_number.bestam_utetemp","entityidfiltertype":"exact","outputinitially":false,"state_type":"str","haltifstate":"","halt_if_type":"str","halt_if_compare":"is","outputs":1,"output_only_on_state_change":true,"for":"0","forType":"num","forUnits":"minutes","ignorePrevStateNull":false,"ignorePrevStateUnknown":false,"ignorePrevStateUnavailable":false,"ignoreCurrentStateUnknown":false,"ignoreCurrentStateUnavailable":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"eventData"},{"property":"topic","propertyType":"msg","value":"","valueType":"triggerId"}],"x":170,"y":1970,"wires":[["18c9e5a0be408c48","e670d3f6746bddaf"]]},{"id":"d81809ff2278c53b","type":"function","z":"5c6241124b106109","name":"Framl. -> Temp","func":"//Begärd Framledningstemp IN : Utetemp UT\nvar loc = {\n \"60.0\" : -27,\n \"59.0\" : -25,\n \"58.0\" : -24,\n \"57.0\" : -23,\n \"56.0\" : -22,\n \"55.0\" : -21,\n \"54.0\" : -20,\n \"53.0\" : -19,\n \"52.0\" : -18,\n \"51.0\" : -16,\n \"50.0\" : -15,\n \"49.0\" : -14,\n \"48.0\" : -13,\n \"47.0\" : -12,\n \"46.0\" : -11,\n \"45.0\" : -10,\n \"44.0\" : -8,\n \"43.0\" : -7,\n \"42.0\" : -6,\n \"41.0\" : -5,\n \"40.0\" : -4,\n \"39.0\" : -2,\n \"38.0\" : -1,\n \"37.0\" : 0,\n \"36.0\" : 2,\n \"35.0\" : 3,\n \"34.0\" : 4,\n \"33.0\" : 5,\n \"32.0\" : 6,\n \"31.0\" : 7,\n \"30.0\" : 8,\n \"29.0\" : 10,\n \"28.0\" : 11,\n \"27.0\" : 12,\n \"26.0\" : 14,\n \"25.0\" : 15,\n \"24.0\" : 16,\n \"23.0\" : 17,\n \"22.0\" : 18,\n \"21.0\" : 19,\n \"20.0\" : 20,\n \"19.0\" : 25,\n \"18.0\" : 25,\n \"17.0\" : 25,\n \"16.0\" : 25,\n \"15.0\" : 25,\n \"14.0\" : 25,\n \"13.0\" : 25,\n \"12.0\" : 25,\n \"11.0\" : 25,\n \"10.0\" : 25\n};\n\nmsg.payload = loc[msg.payload];\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":360,"y":2030,"wires":[[]]},{"id":"04dce0c1a4554752","type":"api-call-service","z":"5c6241124b106109","name":"Set Temp","server":"e3faae9c.59214","version":5,"debugenabled":false,"domain":"input_number","service":"set_value","areaId":[],"deviceId":[],"entityId":["input_number.bestam_utetemp"],"data":"{\"value\":msg.payload}","dataType":"jsonata","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":550,"y":2030,"wires":[[]]},{"id":"e670d3f6746bddaf","type":"function","z":"5c6241124b106109","name":"Temp -> Framl.","func":"//Begärd Temp in : Framledningstemp ut\nvar loc = {\n \"25.0\" : 10,\n \"24.0\" : 10,\n \"23.0\" : 10,\n \"22.0\" : 10,\n \"21.0\" : 10,\n \"20.0\" : 20,\n \"19.0\" : 21,\n \"18.0\" : 22,\n \"17.0\" : 23,\n \"16.0\" : 24,\n \"15.0\" : 25,\n \"14.0\" : 26,\n \"13.0\" : 26,\n \"12.0\" : 27,\n \"11.0\" : 28,\n \"10.0\" : 29,\n \"9.0\" : 29,\n \"8.0\" : 30,\n \"7.0\" : 31,\n \"6.0\" : 32,\n \"5.0\" : 33,\n \"4.0\" : 34,\n \"3.0\" : 35,\n \"2.0\" : 36,\n \"1.0\" : 36,\n \"0.0\" : 37,\n \"-1.0\": 38,\n \"-2.0\": 39,\n \"-3.0\": 40,\n \"-4.0\": 40,\n \"-5.0\": 41,\n \"-6.0\": 42,\n \"-7.0\": 43,\n \"-8.0\": 44,\n \"-9.0\": 45,\n \"-10.0\": 45,\n \"-11.0\": 46,\n \"-12.0\": 47,\n \"-13.0\": 48,\n \"-14.0\": 49,\n \"-15.0\": 50,\n \"-16.0\": 51,\n \"-17.0\": 51,\n \"-18.0\": 52,\n \"-19.0\": 53,\n \"-20.0\": 54,\n \"-21.0\": 55,\n \"-22.0\": 56,\n \"-23.0\": 57,\n \"-24.0\": 58,\n \"-25.0\": 59,\n \"-26.0\": 59,\n \"-27.0\": 60,\n \"-28.0\": 60,\n \"-29.0\": 60,\n \"-30.0\": 60\n};\n\nvar temp = Number(msg.payload);\nvar output = (temp * -0.95) + 39\nmsg.payload = Math.floor(output)\n\n// y = -0.95x + 39 där y är framledningstemp och x är ute-temp\n\n//msg.payload = loc[msg.payload];\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":360,"y":1920,"wires":[["9bbd144669f9492a"]]},{"id":"9bbd144669f9492a","type":"api-call-service","z":"5c6241124b106109","name":"Set Framl.","server":"e3faae9c.59214","version":5,"debugenabled":false,"domain":"input_number","service":"set_value","areaId":[],"deviceId":[],"entityId":["input_number.bestam_framledningstemp"],"data":"{\"value\":msg.payload}","dataType":"jsonata","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":560,"y":1920,"wires":[[]]},{"id":"30ad3eba202bf66d","type":"comment","z":"5c6241124b106109","name":"IVT490 - Hantera digital resistor","info":"","x":230,"y":1870,"wires":[]},{"id":"e3faae9c.59214","type":"server","name":"Home Assistant","version":5,"addon":true,"rejectUnauthorizedCerts":true,"ha_boolean":"y|yes|true|on|home|open","connectionDelay":true,"cacheJson":true,"heartbeat":false,"heartbeatInterval":"30","areaSelector":"friendlyName","deviceSelector":"friendlyName","entitySelector":"friendlyName","statusSeparator":"at: ","statusYear":"hidden","statusMonth":"short","statusDay":"numeric","statusHourCycle":"h23","statusTimeFormat":"h:m","enableGlobalContextStore":true}]