Advertisement
Guest User

Logic 1 and logic 2

a guest
Jan 16th, 2023
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 16.72 KB | None | 0 0
  1. [{"id":"9bad10696ced1566","type":"delay","z":"a8b6b9981e2da679","name":"","pauseType":"delay","timeout":"10","timeoutUnits":"seconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"allowrate":false,"outputs":1,"x":1160,"y":160,"wires":[["2d2ed0a0e8b2fa38"]]},{"id":"434a9df0a02f0d4e","type":"trigger","z":"a8b6b9981e2da679","name":"","op1":"1","op2":"0","op1type":"str","op2type":"str","duration":"0","extend":false,"overrideDelay":false,"units":"ms","reset":"reset","bytopic":"all","topic":"topic","outputs":1,"x":840,"y":60,"wires":[["23389bfddc70fa3e","9bad10696ced1566","287221fb60d6f20b","06c1327afa586087","a55468d10fba3b4f"]]},{"id":"23389bfddc70fa3e","type":"change","z":"a8b6b9981e2da679","name":"set to 10% SoC","rules":[{"t":"set","p":"payload","pt":"msg","to":"10","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1140,"y":100,"wires":[["10f9d8a0dd8e1669"]]},{"id":"287221fb60d6f20b","type":"change","z":"a8b6b9981e2da679","name":"Set Reset","rules":[{"t":"set","p":"payload","pt":"msg","to":"reset","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":840,"y":200,"wires":[["70f0cce4333fc891"]]},{"id":"70f0cce4333fc891","type":"trigger","z":"a8b6b9981e2da679","name":"","op1":"1","op2":"0","op1type":"str","op2type":"str","duration":"0","extend":false,"overrideDelay":false,"units":"ms","reset":"reset","bytopic":"all","topic":"topic","outputs":1,"x":840,"y":260,"wires":[["c7a3fde910105dab","c5115051a223c66e","9bad10696ced1566","2fee7ea8a8cd1f6f","7c4ed57ca9a65e4c"]]},{"id":"c7a3fde910105dab","type":"change","z":"a8b6b9981e2da679","name":"Set Reset","rules":[{"t":"set","p":"payload","pt":"msg","to":"reset","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":840,"y":120,"wires":[["434a9df0a02f0d4e"]]},{"id":"c5115051a223c66e","type":"change","z":"a8b6b9981e2da679","name":"set to 100% SoC","rules":[{"t":"set","p":"payload","pt":"msg","to":"100","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1150,"y":220,"wires":[["0ebc8f2251113779"]]},{"id":"a5e33e677b9eac3f","type":"and-gate","z":"a8b6b9981e2da679","name":"Turn off Battery discharge","rules":[{"t":"lte","v":"60","vt":"num","propertyType":"msg","property":"payload","topic":"sensor.growatt_battery_state_of_charge"},{"t":"eq","v":"100","vt":"num","propertyType":"msg","property":"payload","topic":"input_select.growatt_charge_final_soc"},{"t":"lt","v":"1","vt":"num","propertyType":"msg","property":"payload","topic":"sensor.tv22_power"}],"outputTopic":"","gateType":"and","emitOnlyIfTrue":true,"x":390,"y":160,"wires":[["b82d54f1dd5dc412"]]},{"id":"07f8d19af09c2fd0","type":"and-gate","z":"a8b6b9981e2da679","name":"Turn on Battery discharge","rules":[{"t":"gte","v":"70","vt":"num","propertyType":"msg","property":"payload","topic":"sensor.growatt_battery_state_of_charge"},{"t":"eq","v":"10","vt":"num","propertyType":"msg","property":"payload","topic":"input_select.growatt_charge_final_soc"},{"t":"lt","v":"1","vt":"num","propertyType":"msg","property":"payload","topic":"sensor.tv22_power"}],"outputTopic":"","gateType":"and","emitOnlyIfTrue":true,"x":390,"y":220,"wires":[["70f0cce4333fc891"]]},{"id":"8326cb822fb3b450","type":"and-gate","z":"a8b6b9981e2da679","name":"Turn off Battery discharge","rules":[{"t":"gt","v":"1","vt":"num","propertyType":"msg","property":"payload","topic":"sensor.tv22_power"}],"outputTopic":"","gateType":"and","emitOnlyIfTrue":true,"x":390,"y":100,"wires":[["b82d54f1dd5dc412"]]},{"id":"1b06b54d16db4c69","type":"cronplus","z":"a8b6b9981e2da679","name":"","outputField":"payload","timeZone":"Europe/Copenhagen","persistDynamic":false,"commandResponseMsgOutput":"output1","outputs":1,"options":[{"name":"schedule1","topic":"schedule1","payloadType":"default","payload":"","expressionType":"cron","expression":"59 16 * * *","location":"","offset":"0","solarType":"all","solarEvents":"sunrise,sunset"}],"x":620,"y":200,"wires":[["70f0cce4333fc891"]]},{"id":"b82d54f1dd5dc412","type":"time-range-switch","z":"a8b6b9981e2da679","name":"","lat":"","lon":"","startTime":"07:01","endTime":"16:58","startOffset":0,"endOffset":0,"x":610,"y":100,"wires":[["434a9df0a02f0d4e"],[]]},{"id":"366eb4a6eebf5eb0","type":"poll-state","z":"a8b6b9981e2da679","name":"EV Chg kW","server":"41db9d4b.32b194","version":2,"exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"updateinterval":"30","updateIntervalType":"num","updateIntervalUnits":"seconds","outputinitially":true,"outputonchanged":true,"entity_id":"sensor.tv22_power","state_type":"num","halt_if":"","halt_if_type":"num","halt_if_compare":"is","outputs":1,"x":110,"y":160,"wires":[["8326cb822fb3b450","a5e33e677b9eac3f","07f8d19af09c2fd0"]]},{"id":"d8647a1a343baf44","type":"poll-state","z":"a8b6b9981e2da679","name":"Get battery SoC","server":"41db9d4b.32b194","version":2,"exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"updateinterval":"30","updateIntervalType":"num","updateIntervalUnits":"seconds","outputinitially":true,"outputonchanged":true,"entity_id":"sensor.growatt_battery_state_of_charge","state_type":"num","halt_if":"","halt_if_type":"str","halt_if_compare":"is","outputs":1,"x":120,"y":100,"wires":[["07f8d19af09c2fd0","a5e33e677b9eac3f"]]},{"id":"8cef9cc30e32d1d2","type":"poll-state","z":"a8b6b9981e2da679","name":"SoC max chg","server":"41db9d4b.32b194","version":2,"exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"updateinterval":"30","updateIntervalType":"num","updateIntervalUnits":"seconds","outputinitially":true,"outputonchanged":false,"entity_id":"sensor.template_adgw_battery_first_charge_stopped_soc","state_type":"str","halt_if":"","halt_if_type":"str","halt_if_compare":"is","outputs":1,"x":110,"y":220,"wires":[["07f8d19af09c2fd0","a5e33e677b9eac3f"]]},{"id":"06c1327afa586087","type":"api-call-service","z":"a8b6b9981e2da679","name":"AC charge on","server":"4bbca37b.1700ec","version":5,"debugenabled":false,"domain":"input_boolean","service":"turn_on","areaId":[],"deviceId":[],"entityId":["input_boolean.adgw_ac_charge_on"],"data":"","dataType":"jsonata","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","output_location":"","output_location_type":"none","x":1380,"y":20,"wires":[[]]},{"id":"10f9d8a0dd8e1669","type":"api-call-service","z":"a8b6b9981e2da679","name":"SoC max chg","server":"4bbca37b.1700ec","version":5,"debugenabled":true,"domain":"input_select","service":"select_option","areaId":[],"deviceId":[],"entityId":["input_select.adgw_battery_charge_max_soc"],"data":"{\"option\":\"{{payload}}\"}","dataType":"json","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","output_location":"","output_location_type":"none","x":1380,"y":100,"wires":[[]]},{"id":"2d2ed0a0e8b2fa38","type":"api-call-service","z":"a8b6b9981e2da679","name":"Set settings","server":"4bbca37b.1700ec","version":5,"debugenabled":false,"domain":"input_button","service":"press","areaId":[],"deviceId":[],"entityId":["input_button.adgw_set_charge_settings_button"],"data":"","dataType":"jsonata","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","output_location":"","output_location_type":"none","x":1370,"y":160,"wires":[[]]},{"id":"0ebc8f2251113779","type":"api-call-service","z":"a8b6b9981e2da679","name":"SoC max chg","server":"4bbca37b.1700ec","version":5,"debugenabled":true,"domain":"input_select","service":"select_option","areaId":[],"deviceId":[],"entityId":["input_select.adgw_battery_charge_max_soc"],"data":"{\"option\":\"{{payload}}\"}","dataType":"json","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","output_location":"","output_location_type":"none","x":1380,"y":220,"wires":[[]]},{"id":"2fee7ea8a8cd1f6f","type":"api-call-service","z":"a8b6b9981e2da679","name":"AC charge off","server":"4bbca37b.1700ec","version":5,"debugenabled":false,"domain":"input_boolean","service":"turn_off","areaId":[],"deviceId":[],"entityId":["input_boolean.adgw_ac_charge_on","input_boolean.adgw_ac_charge_off"],"data":"","dataType":"jsonata","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","output_location":"","output_location_type":"none","x":1380,"y":300,"wires":[[]]},{"id":"a55468d10fba3b4f","type":"api-call-service","z":"a8b6b9981e2da679","name":"Time slot on","server":"4bbca37b.1700ec","version":5,"debugenabled":false,"domain":"input_boolean","service":"turn_on","areaId":[],"deviceId":[],"entityId":["input_boolean.adgw_battery_first_time_slot_1_enabled"],"data":"","dataType":"jsonata","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","output_location":"","output_location_type":"none","x":1370,"y":60,"wires":[[]]},{"id":"7c4ed57ca9a65e4c","type":"api-call-service","z":"a8b6b9981e2da679","name":"Time slot off","server":"4bbca37b.1700ec","version":5,"debugenabled":false,"domain":"input_boolean","service":"turn_off","areaId":[],"deviceId":[],"entityId":["input_boolean.adgw_battery_first_time_slot_1_enabled"],"data":"","dataType":"jsonata","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","output_location":"","output_location_type":"none","x":1370,"y":260,"wires":[[]]},{"id":"c7b0b26ab63f90b0","type":"delay","z":"a8b6b9981e2da679","name":"","pauseType":"delay","timeout":"10","timeoutUnits":"seconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"allowrate":false,"outputs":1,"x":1180,"y":500,"wires":[["e06977dd2ac73c9a"]]},{"id":"e06977dd2ac73c9a","type":"api-call-service","z":"a8b6b9981e2da679","name":"Set settings","server":"4bbca37b.1700ec","version":5,"debugenabled":false,"domain":"input_button","service":"press","areaId":[],"deviceId":[],"entityId":["input_button.adgw_set_charge_settings_button"],"data":"","dataType":"jsonata","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","output_location":"","output_location_type":"none","x":1370,"y":500,"wires":[[]]},{"id":"3868766d862fc196","type":"trigger-state","z":"a8b6b9981e2da679","name":"Billigste elpris","server":"694f223e.a8eb6c","version":2,"exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"entityid":"binary_sensor.billigste_opladningspris","entityidfiltertype":"exact","debugenabled":false,"constraints":[{"targetType":"this_entity","targetValue":"","propertyType":"current_state","propertyValue":"new_state.state","comparatorType":"is","comparatorValueDatatype":"str","comparatorValue":"on"}],"inputs":0,"outputs":2,"customoutputs":[],"outputinitially":false,"state_type":"str","enableInput":false,"x":110,"y":420,"wires":[["a8597362a810b2bd"],[]]},{"id":"8016b2db1fb4038f","type":"bigtimer","z":"a8b6b9981e2da679","outtopic":"","outpayload1":"on","outpayload2":"off","name":"Sunrise/Sunset","comment":"-2 hours on","lat":"56.5","lon":"9.14","starttime":"5003","endtime":"5004","starttime2":0,"endtime2":0,"startoff":"-120","endoff":"0","startoff2":0,"endoff2":0,"offs":0,"outtext1":"on","outtext2":"off","timeout":1440,"sun":true,"mon":true,"tue":true,"wed":true,"thu":true,"fri":true,"sat":true,"jan":true,"feb":true,"mar":true,"apr":true,"may":true,"jun":true,"jul":true,"aug":true,"sep":true,"oct":true,"nov":true,"dec":true,"day1":0,"month1":0,"day2":0,"month2":0,"day3":0,"month3":0,"day4":0,"month4":0,"day5":0,"month5":0,"day6":0,"month6":0,"day7":0,"month7":0,"day8":0,"month8":0,"day9":0,"month9":0,"day10":0,"month10":0,"day11":0,"month11":0,"day12":0,"month12":0,"d1":0,"w1":0,"d2":0,"w2":0,"d3":0,"w3":0,"d4":0,"w4":0,"d5":0,"w5":0,"d6":0,"w6":0,"xday1":0,"xmonth1":0,"xday2":0,"xmonth2":0,"xday3":0,"xmonth3":0,"xday4":0,"xmonth4":0,"xday5":0,"xmonth5":0,"xday6":0,"xmonth6":0,"xday7":0,"xmonth7":0,"xday8":0,"xmonth8":0,"xday9":0,"xmonth9":0,"xday10":0,"xmonth10":0,"xday11":0,"xmonth11":0,"xday12":0,"xmonth12":0,"xd1":0,"xw1":0,"xd2":0,"xw2":0,"xd3":0,"xw3":0,"xd4":0,"xw4":0,"xd5":0,"xw5":0,"xd6":0,"xw6":0,"suspend":false,"random":false,"randon1":false,"randoff1":false,"randon2":false,"randoff2":false,"repeat":false,"atstart":true,"odd":false,"even":false,"x":620,"y":480,"wires":[["de6fd4bfcd235996"],[],[]]},{"id":"de6fd4bfcd235996","type":"switch","z":"a8b6b9981e2da679","name":"On switch","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"on","vt":"str"}],"checkall":"true","repair":false,"outputs":1,"x":840,"y":480,"wires":[["c7b0b26ab63f90b0","aed1a8727829f57f","8adba26670a2966d"]]},{"id":"7f5bd1cae33495b7","type":"time-range-switch","z":"a8b6b9981e2da679","name":"","lat":"56.5","lon":"9.14","startTime":"sunset","endTime":"sunrise","startOffset":0,"endOffset":0,"x":620,"y":380,"wires":[["c7b0b26ab63f90b0","92162c8fc68c73c0","33ee15d581bcccd1"],[]]},{"id":"3076b2e39abdc8a2","type":"poll-state","z":"a8b6b9981e2da679","name":"Get battery SoC","server":"41db9d4b.32b194","version":2,"exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"updateinterval":"30","updateIntervalType":"num","updateIntervalUnits":"seconds","outputinitially":true,"outputonchanged":true,"entity_id":"sensor.growatt_battery_state_of_charge","state_type":"num","halt_if":"","halt_if_type":"str","halt_if_compare":"is","outputs":1,"x":120,"y":360,"wires":[["a8597362a810b2bd"]]},{"id":"a8597362a810b2bd","type":"and-gate","z":"a8b6b9981e2da679","name":"Turn on Battery charge","rules":[{"t":"lt","v":"59","vt":"num","propertyType":"msg","property":"payload","topic":"sensor.growatt_battery_state_of_charge"},{"t":"cont","v":"on","vt":"str","propertyType":"msg","property":"payload","topic":"binary_sensor.billigste_opladningspris"}],"outputTopic":"","gateType":"and","emitOnlyIfTrue":true,"x":380,"y":380,"wires":[["7f5bd1cae33495b7"]]},{"id":"92162c8fc68c73c0","type":"api-call-service","z":"a8b6b9981e2da679","name":"AC charge on","server":"4bbca37b.1700ec","version":5,"debugenabled":false,"domain":"input_boolean","service":"turn_on","areaId":[],"deviceId":[],"entityId":["input_boolean.adgw_ac_charge_on"],"data":"","dataType":"jsonata","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","output_location":"","output_location_type":"none","x":1380,"y":440,"wires":[[]]},{"id":"aed1a8727829f57f","type":"api-call-service","z":"a8b6b9981e2da679","name":"AC charge off","server":"4bbca37b.1700ec","version":5,"debugenabled":false,"domain":"input_boolean","service":"turn_off","areaId":[],"deviceId":[],"entityId":["input_boolean.adgw_ac_charge_on","input_boolean.adgw_ac_charge_off"],"data":"","dataType":"jsonata","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","output_location":"","output_location_type":"none","x":1380,"y":560,"wires":[[]]},{"id":"8adba26670a2966d","type":"api-call-service","z":"a8b6b9981e2da679","name":"Time slot off","server":"4bbca37b.1700ec","version":5,"debugenabled":false,"domain":"input_boolean","service":"turn_off","areaId":[],"deviceId":[],"entityId":["input_boolean.adgw_battery_first_time_slot_1_enabled"],"data":"","dataType":"jsonata","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","output_location":"","output_location_type":"none","x":1370,"y":620,"wires":[[]]},{"id":"33ee15d581bcccd1","type":"api-call-service","z":"a8b6b9981e2da679","name":"Time slot on","server":"4bbca37b.1700ec","version":5,"debugenabled":false,"domain":"input_boolean","service":"turn_on","areaId":[],"deviceId":[],"entityId":["input_boolean.adgw_battery_first_time_slot_1_enabled"],"data":"","dataType":"jsonata","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","output_location":"","output_location_type":"none","x":1370,"y":380,"wires":[[]]},{"id":"368e2b499910d8b6","type":"comment","z":"a8b6b9981e2da679","name":"Logic 1","info":"","x":90,"y":40,"wires":[]},{"id":"b4693daf5da3ecb1","type":"comment","z":"a8b6b9981e2da679","name":"Logic 2","info":"","x":90,"y":300,"wires":[]},{"id":"41db9d4b.32b194","type":"server","name":"Home Assistant","addon":true,"rejectUnauthorizedCerts":true,"ha_boolean":"","connectionDelay":false,"cacheJson":false,"heartbeat":false,"heartbeatInterval":"","statusSeparator":"","enableGlobalContextStore":false},{"id":"4bbca37b.1700ec","type":"server","name":"Home Assistant","addon":true,"rejectUnauthorizedCerts":true,"ha_boolean":"y|yes|true|on|home|open","connectionDelay":true,"cacheJson":true},{"id":"694f223e.a8eb6c","type":"server","name":"Home Assistant","version":5,"addon":true,"rejectUnauthorizedCerts":true,"ha_boolean":"y|yes|true|on|home|open","connectionDelay":false,"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}]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement