Confused about and / or logic

Hi beautiful people of the interwebs;

I have a newby / stupid question and I hope someone will be nice enough to clear this up. I have many scenario’s where a bunch of conditions must be true before I want something to happen. E.g. I want a light to switch off, only at a certain time, certain day and certain month but only when I am home and it is not a bank holiday. The problem I have is how to constrain the flow from left to right. It seems any check I put in midway will fire regardless of the rest. In the example below I am trying to get around the kids leaving stuff on. However the iCal will fire off an event when they change, BigTimer will fire off an event when it becomes true (as in the times and days etc) regardless of what happens before. I tried to stop BigTimer by adding a payload = stop on the input when I want to circumvent it but it just ignores that and does it’s thing. This seems to be true for all midway checks in any flow. The attached is just a simple example…

Thanks for any input!


[{"id":"d119cb9b6d86671b","type":"switch","z":"3203d100f79df814","name":"auto :: stop","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"auto","vt":"str"},{"t":"eq","v":"stop","vt":"str"}],"checkall":"true","repair":false,"outputs":2,"x":1030,"y":1020,"wires":[["b10b590c0b73ce32","7f108a471e11384d","3aa816ba519c5820","143413d7701c4eb3"],["62104d556b847321","fb51e5786e39e00f","4e74db97cbfa10cc"]]},{"id":"8d6380f9eba83853","type":"ical-sensor","z":"3203d100f79df814","confignode":"cf93344624eb678a","timeout":"","timeoutUnits":"seconds","name":"SchoolHolidays","trigger":"always","timezone":"","filterProperty":"summary","filterOperator":"between","combineResponse":false,"filter2":"","filter":"","x":440,"y":1040,"wires":[["ca3b46e81c3ff49f"],[]]},{"id":"0cbf648027c90be0","type":"change","z":"3203d100f79df814","name":"on","rules":[{"t":"set","p":"payload","pt":"msg","to":"on","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":910,"y":880,"wires":[["eeb46c9bc1dccb8f"]]},{"id":"667dc926ded2606c","type":"ical-sensor","z":"3203d100f79df814","confignode":"753b8031.1b6ec","timeout":"","timeoutUnits":"seconds","name":"bankhols","trigger":"always","timezone":"Greenwich","filterProperty":"summary","filterOperator":"between","combineResponse":false,"filter2":"","filter":"","x":420,"y":980,"wires":[["ed4cfb5488769177"],[]]},{"id":"b10b590c0b73ce32","type":"bigtimer","z":"3203d100f79df814","outtopic":"","outpayload1":"on","outpayload2":"off","name":"Weekends","comment":"","lat":"51.9572","lon":"-1.9692","starttime":"5004","endtime":"1140","starttime2":"1230","endtime2":"0","startoff":"0","endoff":"0","startoff2":0,"endoff2":0,"offs":0,"outtext1":"on","outtext2":"off","timeout":1440,"sun":true,"mon":false,"tue":false,"wed":false,"thu":false,"fri":false,"sat":true,"jan":true,"feb":true,"mar":true,"apr":false,"may":false,"jun":false,"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":"","month7":"","day8":"","month8":"","day9":"","month9":"","day10":"","month10":"","day11":"","month11":"","day12":"","month12":"","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":"","xmonth7":"","xday8":"","xmonth8":"","xday9":"","xmonth9":"","xday10":"","xmonth10":"","xday11":"","xmonth11":"","xday12":"","xmonth12":"","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":false,"odd":false,"even":false,"x":1270,"y":700,"wires":[["75fa9366f3b71532","3a2501fed6096eff"],[],[]]},{"id":"7f108a471e11384d","type":"bigtimer","z":"3203d100f79df814","outtopic":"","outpayload1":"on","outpayload2":"off","name":"Weekdays","comment":"","lat":"51.9572","lon":"-1.9692","starttime":"5001","endtime":"1140","starttime2":"1260","endtime2":"1410","startoff":"0","endoff":"0","startoff2":0,"endoff2":0,"offs":0,"outtext1":"on","outtext2":"off","timeout":1440,"sun":false,"mon":true,"tue":true,"wed":true,"thu":true,"fri":true,"sat":false,"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":"","month7":"","day8":"","month8":"","day9":"","month9":"","day10":"","month10":"","day11":"","month11":"","day12":"","month12":"","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":"","xmonth7":"","xday8":"","xmonth8":"","xday9":"","xmonth9":"","xday10":"","xmonth10":"","xday11":"","xmonth11":"","xday12":"","xmonth12":"","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":false,"odd":false,"even":false,"x":1270,"y":760,"wires":[["75fa9366f3b71532","3a2501fed6096eff"],[],[]]},{"id":"f72cb5c95233b213","type":"api-current-state","z":"3203d100f79df814","name":"are we home?","server":"6423cd7.3011434","version":3,"outputs":2,"halt_if":"on","halt_if_type":"str","halt_if_compare":"is","entity_id":"input_boolean.home_at_home","state_type":"str","blockInputOverrides":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"entity"}],"for":0,"forType":"num","forUnits":"minutes","x":440,"y":1140,"wires":[["667dc926ded2606c","8d6380f9eba83853"],["0dd384ac033527ef"]]},{"id":"ca1df4c4144f34f2","type":"poll-state","z":"3203d100f79df814","name":"check every 30mins","server":"6423cd7.3011434","version":2,"exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"updateinterval":"30","updateIntervalType":"num","updateIntervalUnits":"minutes","outputinitially":false,"outputonchanged":true,"entity_id":"input_boolean.home_at_home","state_type":"str","halt_if":"","halt_if_type":"str","halt_if_compare":"is","outputs":1,"x":230,"y":1140,"wires":[["f72cb5c95233b213"]]},{"id":"0dd384ac033527ef","type":"api-current-state","z":"3203d100f79df814","name":"Are we set on hoiday","server":"6423cd7.3011434","version":3,"outputs":2,"halt_if":"on","halt_if_type":"str","halt_if_compare":"is","entity_id":"input_boolean.home_holiday","state_type":"str","blockInputOverrides":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"entity"}],"for":"0","forType":"num","forUnits":"minutes","override_topic":false,"state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","x":660,"y":1260,"wires":[["dfa4a4284f98ec1f"],[]]},{"id":"75fa9366f3b71532","type":"api-call-service","z":"3203d100f79df814","name":"lights On","server":"6423cd7.3011434","version":5,"debugenabled":false,"domain":"switch","service":"turn_on","areaId":[],"deviceId":[],"entityId":["switch.tv_strip"],"data":"","dataType":"jsonata","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":1520,"y":700,"wires":[[]]},{"id":"3a2501fed6096eff","type":"api-call-service","z":"3203d100f79df814","name":"moodlight On","server":"6423cd7.3011434","version":5,"debugenabled":false,"domain":"light","service":"turn_on","areaId":[],"deviceId":[],"entityId":["{{flow.var_lights}}"],"data":"{\"rgb_color\": [235, 164, 52], \"brightness\": 255}","dataType":"jsonata","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":1530,"y":800,"wires":[[]]},{"id":"143413d7701c4eb3","type":"bigtimer","z":"3203d100f79df814","outtopic":"","outpayload1":"off","outpayload2":"off","name":"Time to go to school 8:45","comment":"","lat":"51.9572","lon":"-1.9692","starttime":"525","endtime":"540","starttime2":"540","endtime2":"570","startoff":"0","endoff":"0","startoff2":0,"endoff2":0,"offs":0,"outtext1":"off","outtext2":"off","timeout":1440,"sun":false,"mon":true,"tue":true,"wed":true,"thu":true,"fri":true,"sat":false,"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":"","month7":"","day8":"","month8":"","day9":"","month9":"","day10":"","month10":"","day11":"","month11":"","day12":"","month12":"","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":"","xmonth7":"","xday8":"","xmonth8":"","xday9":"","xmonth9":"","xday10":"","xmonth10":"","xday11":"","xmonth11":"","xday12":"","xmonth12":"","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":false,"odd":false,"even":false,"x":1250,"y":1160,"wires":[["e3b5c2eb0d650156"],[],[]]},{"id":"9db914bc836377da","type":"api-call-service","z":"3203d100f79df814","name":"moodlight off ","server":"6423cd7.3011434","version":5,"debugenabled":false,"domain":"light","service":"turn_off","areaId":[],"deviceId":[],"entityId":["{{flow.var_lights}}"],"data":"","dataType":"jsonata","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":1590,"y":1180,"wires":[[]]},{"id":"02227dbdceec8b4d","type":"api-call-service","z":"3203d100f79df814","name":"tv off","server":"6423cd7.3011434","version":5,"debugenabled":false,"domain":"media_player","service":"turn_off","areaId":[],"deviceId":[],"entityId":["media_player.family_tv"],"data":"","dataType":"jsonata","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":1570,"y":1120,"wires":[[]]},{"id":"62104d556b847321","type":"bigtimer","z":"3203d100f79df814","outtopic":"","outpayload1":"on","outpayload2":"off","name":"Weekends","comment":"","lat":"51.9572","lon":"-1.9692","starttime":"5004","endtime":"1140","starttime2":"1230","endtime2":"0","startoff":"0","endoff":"0","startoff2":0,"endoff2":"1","offs":0,"outtext1":"on","outtext2":"off","timeout":1440,"sun":true,"mon":false,"tue":false,"wed":false,"thu":false,"fri":false,"sat":true,"jan":true,"feb":true,"mar":true,"apr":false,"may":false,"jun":false,"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":"","month7":"","day8":"","month8":"","day9":"","month9":"","day10":"","month10":"","day11":"","month11":"","day12":"","month12":"","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":"","xmonth7":"","xday8":"","xmonth8":"","xday9":"","xmonth9":"","xday10":"","xmonth10":"","xday11":"","xmonth11":"","xday12":"","xmonth12":"","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":false,"odd":false,"even":false,"x":1230,"y":1260,"wires":[["4d3dee4587366f3c","03fb67c2655e76dc"],[],[]]},{"id":"fb51e5786e39e00f","type":"bigtimer","z":"3203d100f79df814","outtopic":"","outpayload1":"on","outpayload2":"off","name":"Weekdays","comment":"","lat":"51.9572","lon":"-1.9692","starttime":"1020","endtime":"1140","starttime2":"1260","endtime2":"1410","startoff":"0","endoff":"0","startoff2":0,"endoff2":0,"offs":0,"outtext1":"on","outtext2":"off","timeout":1440,"sun":false,"mon":true,"tue":true,"wed":true,"thu":true,"fri":true,"sat":false,"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":"","month7":"","day8":"","month8":"","day9":"","month9":"","day10":"","month10":"","day11":"","month11":"","day12":"","month12":"","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":"","xmonth7":"","xday8":"","xmonth8":"","xday9":"","xmonth9":"","xday10":"","xmonth10":"","xday11":"","xmonth11":"","xday12":"","xmonth12":"","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":false,"odd":false,"even":false,"x":1230,"y":1320,"wires":[["4d3dee4587366f3c","03fb67c2655e76dc"],[],[]]},{"id":"4d3dee4587366f3c","type":"api-call-service","z":"3203d100f79df814","name":"lights On","server":"6423cd7.3011434","version":5,"debugenabled":false,"domain":"switch","service":"turn_on","areaId":[],"deviceId":[],"entityId":["switch.tv_strip"],"data":"","dataType":"jsonata","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":1540,"y":1260,"wires":[[]]},{"id":"03fb67c2655e76dc","type":"api-call-service","z":"3203d100f79df814","name":"moodlight On","server":"6423cd7.3011434","version":5,"debugenabled":false,"domain":"light","service":"turn_on","areaId":[],"deviceId":[],"entityId":["{{flow.var_lights}}"],"data":"{\"rgb_color\": [235, 164, 52], \"brightness\": 255}","dataType":"jsonata","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":1550,"y":1340,"wires":[[]]},{"id":"e3b5c2eb0d650156","type":"switch","z":"3203d100f79df814","name":"switch off","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"off","vt":"str"}],"checkall":"true","repair":false,"outputs":1,"x":1400,"y":1080,"wires":[["9db914bc836377da","02227dbdceec8b4d"]]},{"id":"3aa816ba519c5820","type":"bigtimer","z":"3203d100f79df814","outtopic":"","outpayload1":"on","outpayload2":"on","name":"Mornings on","comment":"","lat":"51.9572","lon":"-1.9692","starttime":"5000","endtime":"5003","starttime2":"5000","endtime2":"5003","startoff":"0","endoff":"0","startoff2":0,"endoff2":0,"offs":0,"outtext1":"on","outtext2":"on","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":"","month7":"","day8":"","month8":"","day9":"","month9":"","day10":"","month10":"","day11":"","month11":"","day12":"","month12":"","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":"","xmonth7":"","xday8":"","xmonth8":"","xday9":"","xmonth9":"","xday10":"","xmonth10":"","xday11":"","xmonth11":"","xday12":"","xmonth12":"","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":false,"odd":false,"even":false,"x":1270,"y":820,"wires":[["75fa9366f3b71532"],[],[]]},{"id":"4e74db97cbfa10cc","type":"bigtimer","z":"3203d100f79df814","outtopic":"","outpayload1":"on","outpayload2":"on","name":"Mornings on","comment":"","lat":"51.9572","lon":"-1.9692","starttime":"5000","endtime":"5003","starttime2":"5000","endtime2":"5003","startoff":"0","endoff":"0","startoff2":0,"endoff2":0,"offs":0,"outtext1":"on","outtext2":"on","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":"","month7":"","day8":"","month8":"","day9":"","month9":"","day10":"","month10":"","day11":"","month11":"","day12":"","month12":"","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":"","xmonth7":"","xday8":"","xmonth8":"","xday9":"","xmonth9":"","xday10":"","xmonth10":"","xday11":"","xmonth11":"","xday12":"","xmonth12":"","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":false,"odd":false,"even":false,"x":1230,"y":1380,"wires":[["4d3dee4587366f3c","03fb67c2655e76dc"],[],[]]},{"id":"ed4cfb5488769177","type":"switch","z":"3203d100f79df814","name":"switch boolean true :: false","property":"payload.on","propertyType":"msg","rules":[{"t":"true"},{"t":"false"}],"checkall":"true","repair":false,"outputs":2,"x":680,"y":960,"wires":[["0cbf648027c90be0"],["693e3fde89558b32"]]},{"id":"ca3b46e81c3ff49f","type":"switch","z":"3203d100f79df814","name":"switch boolean true :: false","property":"payload.on","propertyType":"msg","rules":[{"t":"true"},{"t":"false"}],"checkall":"true","repair":false,"outputs":2,"x":680,"y":1020,"wires":[["0cbf648027c90be0"],["693e3fde89558b32"]]},{"id":"693e3fde89558b32","type":"change","z":"3203d100f79df814","name":"off","rules":[{"t":"set","p":"payload","pt":"msg","to":"off","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":930,"y":1080,"wires":[["d119cb9b6d86671b"]]},{"id":"eeb46c9bc1dccb8f","type":"switch","z":"3203d100f79df814","name":"auto","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"auto","vt":"str"},{"t":"eq","v":"stop","vt":"str"}],"checkall":"true","repair":false,"outputs":2,"x":1010,"y":940,"wires":[["62104d556b847321","fb51e5786e39e00f","4e74db97cbfa10cc"],["3aa816ba519c5820","7f108a471e11384d","b10b590c0b73ce32"]]},{"id":"dfa4a4284f98ec1f","type":"change","z":"3203d100f79df814","name":"on holiday","rules":[{"t":"set","p":"payload","pt":"msg","to":"stop","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":950,"y":1260,"wires":[["62104d556b847321","fb51e5786e39e00f","4e74db97cbfa10cc","143413d7701c4eb3","3aa816ba519c5820","7f108a471e11384d","b10b590c0b73ce32"]]},{"id":"cf93344624eb678a","type":"ical-config","url":"https://calendar.google.com/calendar/ical/5s4njs214nfhoefjd8kmfl5lv8%40group.calendar.google.com/public/basic.ics","caldav":"","caltype":"ical","name":"SchoolHolidays","replacedates":false,"usecache":false,"username":"","includeTodo":false,"password":"","calendar":"","pastWeeks":"0","futureWeeks":"4"},{"id":"753b8031.1b6ec","type":"ical-config","url":"https://www.officeholidays.com/ics-clean/united-kingdom/england","caldav":"false","caltype":"ical","name":"bankhols","replacedates":false,"usecache":false,"username":"","includeTodo":false,"password":"","calendar":"","pastWeeks":"0","futureWeeks":"4"},{"id":"6423cd7.3011434","type":"server","name":"HA","version":2,"addon":false,"rejectUnauthorizedCerts":true,"ha_boolean":"y|yes|true|on|home|open","connectionDelay":true,"cacheJson":false,"heartbeat":false,"heartbeatInterval":30}]

I have a hard time understanding your sequence. But to answer the question, the upper one is AND, the lower is OR.

Meaning if the conditions are in line with each other if any of them is false the message stops.
If the conditions are parallell then the message slips through is either one is true (keep in mind if all is true you get multiple call service executed, this can be throttled with a delay node set to rate limit)

Thanks for that, that is what I thought, but my issue is I keep finding the ‘do-something’ triggers regardless of what is before it.

Your first current state has no condition in it, if it had it would have two outbound connections and the state of the entity is “off”.
Same thing with the PIR, there is no condition in it.

Hi yes, I tried to just put it simply but looking at it again I think it might be an issue with BigTimer… when you have BigTimer in your flow it seems to fire regardless of any input. I need to override that at certain times… will see if I can come up with a function node or something. I thought passing a payload of ‘stop’ will totally override a BigTimer, but it seems not…

It seems a lot of people, starting off stumble upon big timer, I did. I think it’s an over complicated node that replicates functionality that already exists in node red.

Start/stop times, a simple inject node set to a daily repeat.

Time conditions where a trigger does one thing at one time, something else another time.
image

Sunrise node or use sun.sun in an event state node for sunset/sunrise.

traffic nodes can pause a flow and dump or resend the message when it’s released.
image
Trigger state and event state nodes can be enabled/disabled as well.

Here are two flows that provide some ways to do and, or and nand.
Its just using the if state option in the nodes and then linking them together in different ways.

[{"id":"862b54ae53f0bbbc","type":"api-current-state","z":"e0e2243bd15449ee","name":"","server":"541ade28.b4a62","version":3,"outputs":2,"halt_if":"true","halt_if_type":"str","halt_if_compare":"is","entity_id":"bank holiday","state_type":"str","blockInputOverrides":false,"outputProperties":[],"for":"0","forType":"num","forUnits":"minutes","override_topic":false,"state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","x":750,"y":255,"wires":[["846903b15adbf0f6"],["f00a41fc324e4d00"]]},{"id":"f00a41fc324e4d00","type":"api-current-state","z":"e0e2243bd15449ee","name":"","server":"541ade28.b4a62","version":3,"outputs":2,"halt_if":"true","halt_if_type":"str","halt_if_compare":"is","entity_id":"I am home","state_type":"str","blockInputOverrides":false,"outputProperties":[],"for":"0","forType":"num","forUnits":"minutes","override_topic":false,"state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","x":740,"y":330,"wires":[["846903b15adbf0f6"],["55c0b33bce785e45"]]},{"id":"55c0b33bce785e45","type":"api-current-state","z":"e0e2243bd15449ee","name":"","server":"541ade28.b4a62","version":3,"outputs":2,"halt_if":"true","halt_if_type":"str","halt_if_compare":"is","entity_id":"it is night","state_type":"str","blockInputOverrides":false,"outputProperties":[],"for":"0","forType":"num","forUnits":"minutes","override_topic":false,"state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","x":740,"y":405,"wires":[["846903b15adbf0f6"],["997269ac269e0021"]]},{"id":"997269ac269e0021","type":"api-current-state","z":"e0e2243bd15449ee","name":"","server":"541ade28.b4a62","version":3,"outputs":2,"halt_if":"true","halt_if_type":"str","halt_if_compare":"is","entity_id":"it is summer","state_type":"str","blockInputOverrides":false,"outputProperties":[],"for":"0","forType":"num","forUnits":"minutes","override_topic":false,"state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","x":750,"y":480,"wires":[["846903b15adbf0f6"],["b1c61d0c85d9d300"]]},{"id":"846903b15adbf0f6","type":"debug","z":"e0e2243bd15449ee","name":"Or result (Atleast one is true)","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":1090,"y":255,"wires":[]},{"id":"b1c61d0c85d9d300","type":"debug","z":"e0e2243bd15449ee","name":"Nand result (None is true)","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":1085,"y":480,"wires":[]},{"id":"22246f3da994323f","type":"inject","z":"e0e2243bd15449ee","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":480,"y":255,"wires":[["862b54ae53f0bbbc"]]},{"id":"9afe71d3b8cd1adc","type":"api-current-state","z":"e0e2243bd15449ee","name":"","server":"541ade28.b4a62","version":3,"outputs":2,"halt_if":"true","halt_if_type":"str","halt_if_compare":"is","entity_id":"bank holiday","state_type":"str","blockInputOverrides":false,"outputProperties":[],"for":"0","forType":"num","forUnits":"minutes","override_topic":false,"state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","x":765,"y":555,"wires":[["f9d5dd33a8546b22"],["de56958877a45e50"]]},{"id":"f9d5dd33a8546b22","type":"api-current-state","z":"e0e2243bd15449ee","name":"","server":"541ade28.b4a62","version":3,"outputs":2,"halt_if":"true","halt_if_type":"str","halt_if_compare":"is","entity_id":"I am home","state_type":"str","blockInputOverrides":false,"outputProperties":[],"for":"0","forType":"num","forUnits":"minutes","override_topic":false,"state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","x":755,"y":630,"wires":[["a366c671d8824978"],["de56958877a45e50"]]},{"id":"a366c671d8824978","type":"api-current-state","z":"e0e2243bd15449ee","name":"","server":"541ade28.b4a62","version":3,"outputs":2,"halt_if":"true","halt_if_type":"str","halt_if_compare":"is","entity_id":"it is night","state_type":"str","blockInputOverrides":false,"outputProperties":[],"for":"0","forType":"num","forUnits":"minutes","override_topic":false,"state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","x":755,"y":705,"wires":[["bb1840abe264e87d"],["de56958877a45e50"]]},{"id":"bb1840abe264e87d","type":"api-current-state","z":"e0e2243bd15449ee","name":"","server":"541ade28.b4a62","version":3,"outputs":2,"halt_if":"true","halt_if_type":"str","halt_if_compare":"is","entity_id":"it is summer","state_type":"str","blockInputOverrides":false,"outputProperties":[],"for":"0","forType":"num","forUnits":"minutes","override_topic":false,"state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","x":765,"y":780,"wires":[["2bb88d4832b20816"],["de56958877a45e50"]]},{"id":"de56958877a45e50","type":"debug","z":"e0e2243bd15449ee","name":"Or result (Atleast one is false)","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":1115,"y":555,"wires":[]},{"id":"2bb88d4832b20816","type":"debug","z":"e0e2243bd15449ee","name":"And result (All is true)","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":1090,"y":780,"wires":[]},{"id":"237911338342e5ac","type":"inject","z":"e0e2243bd15449ee","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":495,"y":555,"wires":[["9afe71d3b8cd1adc"]]},{"id":"541ade28.b4a62","type":"server","name":"Home Assistant","version":2,"addon":true,"rejectUnauthorizedCerts":true,"ha_boolean":"","connectionDelay":false,"cacheJson":false,"heartbeat":false,"heartbeatInterval":""}]

What about days of the week and months of the year? I could not find anything for that?

Thanks so much for your response(s)

The inject node allows you to pick certain days

image

There is a time node that will let you choose exact dates and times. Create an input datetime helper in HA and set the time node to that entity.

image

The date time can be set from node red, the time formatter(this may need to be added) has a simple interface. It will allow you to add a specified amount to the current time, if you want to set it from an automation.

[{"id":"fdedad9da92efcfb","type":"inject","z":"f80b6c338afd5483","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"00 12 * * *","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":330,"y":400,"wires":[["41455de3409b976c"]]},{"id":"33eebbbd952cfc39","type":"api-call-service","z":"f80b6c338afd5483","name":"","server":"6b1110b5.183a4","version":5,"debugenabled":false,"domain":"input_datetime","service":"set_datetime","areaId":[],"deviceId":[],"entityId":["input_datetime.boiler_morning_boost_time"],"data":"{\"datetime\":\"{{payload}}\"}","dataType":"json","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":940,"y":400,"wires":[[]]},{"id":"41455de3409b976c","type":"moment","z":"f80b6c338afd5483","name":"","topic":"","input":"payload","inputType":"msg","inTz":"America/New_York","adjAmount":"1","adjType":"months","adjDir":"add","format":"YYYY-MM-DD HH:mm:ss","locale":"C","output":"payload","outputType":"msg","outTz":"America/New_York","x":580,"y":400,"wires":[["33eebbbd952cfc39"]]},{"id":"6b1110b5.183a4","type":"server","name":"Home Assistant","version":2,"addon":true,"rejectUnauthorizedCerts":true,"ha_boolean":"y|yes|true|on|home|open","connectionDelay":true,"cacheJson":false,"heartbeat":false,"heartbeatInterval":"30"}]

This might already be solved, but just for the fun of it I made a datetime split/convert function node for NR. :slight_smile:

[{"id":"e819ce763c9d3940","type":"inject","z":"d7ad1e7a2a4af03b","name":"test (US)","props":[{"p":"payload"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":675,"y":450,"wires":[["435a3d7e0ad38370"]]},{"id":"9e14b4aa453ddc32","type":"debug","z":"d7ad1e7a2a4af03b","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":1040,"y":420,"wires":[]},{"id":"435a3d7e0ad38370","type":"function","z":"d7ad1e7a2a4af03b","name":"DateTime","func":"// msg.language is the language code in the form xx-YY. \n// Most of the language codes from here should work: http://www.lingoes.net/en/translator/langcode.htm\n// If no msg.language code is selected, then en-US is default.\n//\n// msg.payload contain the date\n// The script will try to parse a human written datetime, like december 1, 2033 11:25 AM GMT+1\n// If this can not be passed correctly, then it will try to read it as a timestamp value instead\n// Timestamps from within Node-Red works perfectly, but timestamps coming from HA might be missing some digits,\n// so you need to add the missing zeros in the end by *10000 or whatever is missing to reach the same number\n// of digits as Node-Red timestamps.\n\n// more info on the date objects used: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date\n// more info on localization of datetime: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/DateTimeFormat\n\n\nif (!msg.language) { msg.language = 'en-US'}\nvar input = Date.parse(msg.payload);\nif (isNaN(input)) { input = msg.payload }\nvar dateobject = new Date(input)\n\nmsg.timevalue = dateobject.valueOf();\n\nmsg.datestring = new Intl.DateTimeFormat(msg.language, { dateStyle: 'full', timeStyle: 'full' }).format(dateobject);\nmsg.date = dateobject.getDate(); //\n\nmsg.month = new Intl.DateTimeFormat(msg.language, { month: 'numeric' }).format(dateobject);\nmsg.monthshort = new Intl.DateTimeFormat(msg.language, { month: 'short' }).format(dateobject);\nmsg.monthlong = new Intl.DateTimeFormat(msg.language, { month: 'long' }).format(dateobject);\n\nmsg.year = new Intl.DateTimeFormat(msg.language, { year: 'numeric' }).format(dateobject);\nmsg.year2 = new Intl.DateTimeFormat(msg.language, { year: '2-digit' }).format(dateobject);\n\nmsg.day = dateobject.getDay();\nmsg.dayshort = new Intl.DateTimeFormat(msg.language, { weekday: 'short' }).format(dateobject);\nmsg.daylong = new Intl.DateTimeFormat(msg.language, { weekday: 'long' }).format(dateobject);\n\nmsg.hour24 = new Intl.DateTimeFormat(msg.language, { hour: 'numeric', hour12: false }).format(dateobject);\nmsg.hour24_2 = new Intl.DateTimeFormat(msg.language, { hour: '2-digit', hour12: false }).format(dateobject);\nmsg.hour12 = new Intl.DateTimeFormat(msg.language, { hour: 'numeric', hour12: true }).format(dateobject).split(\" \")[0];\nmsg.hour12_2 = new Intl.DateTimeFormat(msg.language, { hour: '2-digit', hour12: true }).format(dateobject).split(\" \")[0];\nmsg.hour12prefix = new Intl.DateTimeFormat(msg.language, { hour: '2-digit', hour12: true }).format(dateobject).split(\" \")[1];\n\nmsg.minute = dateobject.getMinutes();\nmsg.minute2 = new Intl.DateTimeFormat(msg.language, { minute: '2-digit' }).format(dateobject);\n\nmsg.second = dateobject.getSeconds();\nmsg.second2 = new Intl.DateTimeFormat(msg.language, { second: '2-digit' }).format(dateobject);\n\nmsg.timezone = new Intl.DateTimeFormat('en-US', { timeZoneName: 'short' }).format(dateobject).split(\" \")[1];\n\nreturn msg;\n\n","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":885,"y":420,"wires":[["9e14b4aa453ddc32"]]},{"id":"b5835288284fb793","type":"inject","z":"d7ad1e7a2a4af03b","name":"test (DK)","props":[{"p":"payload"},{"p":"language","v":"da","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":675,"y":405,"wires":[["435a3d7e0ad38370"]]},{"id":"0fe44da13360b12c","type":"inject","z":"d7ad1e7a2a4af03b","name":"test (GB)","props":[{"p":"payload"},{"p":"language","v":"en-GB","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":675,"y":495,"wires":[["435a3d7e0ad38370"]]},{"id":"f66e8186ba2ab711","type":"inject","z":"d7ad1e7a2a4af03b","name":"test (DK)","props":[{"p":"payload"},{"p":"language","v":"da-DK","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"24. januar 2024 13:22","payloadType":"str","x":675,"y":360,"wires":[["435a3d7e0ad38370"]]}]

Awesome thanks guys!!

1 Like

Thank you!

I had it exactly as you kind folk explained, but it seems some nodes does not follow that logic, like BIGTIMER for one.

Thanks again for your time!