@CentralCommand yes thats intentional. the “shut down” is a hass workstation command. that executes a windows shutdown command via the hass workstation service that runs on the PC.
the “power off” is the smartswitch that phyically shuts of the switch from which the PC is powered.
the gate comes from “node-red-contrib-boolean-logic” from the many logic gate options I tested this seemed to be the simplest one.
**[{"id":"97aba0f8a5c773f2","type":"tab","label":"Bedroom lights v2","disabled":false,"info":"","env":[]},{"id":"136c13e32b82c7cc","type":"api-call-service","z":"97aba0f8a5c773f2","name":"","server":"","version":5,"debugenabled":false,"domain":"light","service":"turn_off","areaId":[],"deviceId":[],"entityId":["light.osram_weis_level_light_color_on_off"],"data":"","dataType":"jsonata","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":1770,"y":1660,"wires":[["c1d58ef68de71456"]]},{"id":"c1d58ef68de71456","type":"debug","z":"97aba0f8a5c773f2","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":1810,"y":1600,"wires":[]},{"id":"7fd47cc53899440b","type":"server-state-changed","z":"97aba0f8a5c773f2","name":"","server":"","version":4,"exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"entityidfilter":"binary_sensor.ewelink_ms01_9f514525_ias_zone","entityidfiltertype":"exact","outputinitially":false,"state_type":"str","haltifstate":"on","halt_if_type":"str","halt_if_compare":"is","outputs":2,"output_only_on_state_change":true,"for":0,"forType":"num","forUnits":"minutes","ignorePrevStateNull":false,"ignorePrevStateUnknown":false,"ignorePrevStateUnavailable":false,"ignoreCurrentStateUnknown":false,"ignoreCurrentStateUnavailable":false,"outputProperties":[],"x":340,"y":120,"wires":[["b2cc679e55317c4c"],[]]},{"id":"b2cc679e55317c4c","type":"ha-wait-until","z":"97aba0f8a5c773f2","name":"wait until charging","server":"","version":1,"outputs":2,"entityId":"binary_sensor.fig_lx1_is_charging","entityIdFilterType":"exact","property":"state","comparator":"is","value":"on","valueType":"str","timeout":"3","timeoutType":"num","timeoutUnits":"minutes","entityLocation":"data","entityLocationType":"none","checkCurrentState":true,"blockInputOverrides":true,"x":690,"y":120,"wires":[["b21f378f8d05b4c9"],[]]},{"id":"b21f378f8d05b4c9","type":"time-range-switch","z":"97aba0f8a5c773f2","name":"","lat":"","lon":"","startTime":"22:00","endTime":"02:00","startOffset":0,"endOffset":0,"x":890,"y":120,"wires":[["116f994fa4525684","a303451151300304"],[]]},{"id":"33fa5a0c3b51abe5","type":"api-call-service","z":"97aba0f8a5c773f2","name":"Bedroom lights out","server":"","version":5,"debugenabled":false,"domain":"light","service":"turn_off","areaId":[],"deviceId":[],"entityId":["light.osram_weis_level_light_color_on_off"],"data":"","dataType":"jsonata","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"x":610,"y":240,"wires":[[]]},{"id":"116f994fa4525684","type":"api-call-service","z":"97aba0f8a5c773f2","name":"sleep bool on","server":"","version":5,"debugenabled":false,"domain":"input_boolean","service":"turn_on","areaId":[],"deviceId":[],"entityId":["input_boolean.schlafen"],"data":"","dataType":"jsonata","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":1130,"y":140,"wires":[[]]},{"id":"20b2c047924bb830","type":"server-state-changed","z":"97aba0f8a5c773f2","name":"Sleepmode on","server":"","version":4,"exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"entityidfilter":"input_boolean.schlafen","entityidfiltertype":"exact","outputinitially":true,"state_type":"str","haltifstate":"on","halt_if_type":"str","halt_if_compare":"is","outputs":2,"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"}],"x":150,"y":380,"wires":[["33fa5a0c3b51abe5","4ea03322241f1450","849c3d186456fce4","604cf210eafcc475","0cea5219ae66f3a2"],[]]},{"id":"4ea03322241f1450","type":"api-call-service","z":"97aba0f8a5c773f2","name":"Kitchen power off","server":"","version":5,"debugenabled":false,"domain":"switch","service":"turn_off","areaId":[],"deviceId":[],"entityId":["switch.smart_plug_4_socket_1"],"data":"","dataType":"jsonata","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":610,"y":300,"wires":[[]]},{"id":"849c3d186456fce4","type":"api-call-service","z":"97aba0f8a5c773f2","name":"living room lights off","server":"","version":5,"debugenabled":false,"domain":"switch","service":"turn_off","areaId":[],"deviceId":[],"entityId":["switch.wohnzimmerlampe_broadlink_switch"],"data":"","dataType":"jsonata","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":610,"y":360,"wires":[[]]},{"id":"e8958dedc2d55aa2","type":"comment","z":"97aba0f8a5c773f2","name":"Trigger sleep routine","info":"","x":150,"y":40,"wires":[]},{"id":"2798d6a2f10c6788","type":"comment","z":"97aba0f8a5c773f2","name":"Sleep routine","info":"","x":110,"y":240,"wires":[]},{"id":"604cf210eafcc475","type":"delay","z":"97aba0f8a5c773f2","name":"","pauseType":"delay","timeout":"30","timeoutUnits":"seconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"allowrate":false,"outputs":1,"x":580,"y":420,"wires":[["0cdeef54a424fb58"]]},{"id":"7a64fcef3c317b61","type":"api-call-service","z":"97aba0f8a5c773f2","name":"PC, printer, stereo power off","server":"","version":5,"debugenabled":true,"domain":"switch","service":"turn_off","areaId":[],"deviceId":[],"entityId":["switch.pc_socket_1"],"data":"","dataType":"jsonata","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":1160,"y":660,"wires":[[]]},{"id":"0cdeef54a424fb58","type":"api-call-service","z":"97aba0f8a5c773f2","name":"PC shut down","server":"","version":5,"debugenabled":false,"domain":"switch","service":"toggle","areaId":[],"deviceId":[],"entityId":["switch.pccshutdown"],"data":"","dataType":"jsonata","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":760,"y":420,"wires":[["4e32f13f9aa2f759"]]},{"id":"a303451151300304","type":"api-call-service","z":"97aba0f8a5c773f2","name":"awake bool off","server":"","version":5,"debugenabled":false,"domain":"input_boolean","service":"turn_off","areaId":[],"deviceId":[],"entityId":["input_boolean.wach"],"data":"","dataType":"jsonata","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":1140,"y":80,"wires":[[]]},{"id":"cc45eb91e3c013e6","type":"trigger-state","z":"97aba0f8a5c773f2","name":"Hass Worstation dummy sensor unavailable","server":"","version":2,"exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"entityid":"sensor.dummy","entityidfiltertype":"exact","debugenabled":false,"constraints":[{"targetType":"this_entity","targetValue":"","propertyType":"current_state","propertyValue":"new_state.state","comparatorType":"is","comparatorValueDatatype":"str","comparatorValue":"unavailable"}],"inputs":1,"outputs":2,"customoutputs":[],"outputinitially":false,"state_type":"str","enableInput":true,"x":210,"y":640,"wires":[["8d7126c1f5859f71","47c255c08ad3e8e1"],[]]},{"id":"8334a714d54741be","type":"server-state-changed","z":"97aba0f8a5c773f2","name":"","server":"","version":4,"exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"entityidfilter":"binary_sensor.philips_sml001_fc6b090b_occupancy","entityidfiltertype":"exact","outputinitially":false,"state_type":"str","haltifstate":"on","halt_if_type":"str","halt_if_compare":"is","outputs":2,"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":"true","valueType":"bool"},{"property":"topic","propertyType":"msg","value":"motionsensor1","valueType":"str"}],"x":400,"y":1060,"wires":[["54a147affeded3c9","850e15b43e5132c7"],[]]},{"id":"3e0a95c373fbc42b","type":"api-call-service","z":"97aba0f8a5c773f2","name":"Wake turn on","server":"","version":5,"debugenabled":false,"domain":"input_boolean","service":"turn_on","areaId":[],"deviceId":[],"entityId":["input_boolean.wach"],"data":"","dataType":"jsonata","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":1230,"y":1060,"wires":[[]]},{"id":"afa3d74796a04646","type":"api-call-service","z":"97aba0f8a5c773f2","name":"Sleep turn off","server":"","version":5,"debugenabled":false,"domain":"input_boolean","service":"turn_off","areaId":[],"deviceId":[],"entityId":["input_boolean.schlafen"],"data":"","dataType":"jsonata","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":1230,"y":1120,"wires":[[]]},{"id":"c04f6e93afda5182","type":"comment","z":"97aba0f8a5c773f2","name":"Sleep Wake on off","info":"","x":150,"y":1000,"wires":[]},{"id":"54a147affeded3c9","type":"debug","z":"97aba0f8a5c773f2","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":1030,"y":940,"wires":[]},{"id":"1a90a718.5c0409","type":"BooleanLogicUltimate","z":"97aba0f8a5c773f2","name":"","filtertrue":"both","persist":true,"sInitializeWith":"WaitForPayload","triggertopic":"trigger","outputtriggeredby":"all","inputCount":2,"topic":"result","restrictinputevaluation":false,"delayEvaluation":"","x":830,"y":1580,"wires":[["5f9fbfcc.d2c34"],[],[]]},{"id":"81ef6fec.5d413","type":"inject","z":"97aba0f8a5c773f2","name":"Night","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"Dark","payload":"true","payloadType":"bool","x":620,"y":1600,"wires":[["1a90a718.5c0409"]]},{"id":"e0d5d620.966478","type":"inject","z":"97aba0f8a5c773f2","name":"Daylight","repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"Dark","payload":"false","payloadType":"bool","x":610,"y":1560,"wires":[["1a90a718.5c0409"]]},{"id":"1c2f8e73.2c22ba","type":"inject","z":"97aba0f8a5c773f2","name":"Motion detect true","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"Motion","payload":"true","payloadType":"bool","x":580,"y":1660,"wires":[["1a90a718.5c0409"]]},{"id":"5f9fbfcc.d2c34","type":"debug","z":"97aba0f8a5c773f2","name":"Garden Light","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":1030,"y":1580,"wires":[]},{"id":"201baa3d.7c63ae","type":"inject","z":"97aba0f8a5c773f2","name":"Motion detect false","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"Motion","payload":"false","payloadType":"bool","x":580,"y":1700,"wires":[["1a90a718.5c0409"]]},{"id":"b65f4ff4.bfe2c8","type":"comment","z":"97aba0f8a5c773f2","name":"Motion sensor turns on lights, when it's dark. The light turns off itself at day","info":"","x":740,"y":1520,"wires":[]},{"id":"53a10a7a.cf1894","type":"BooleanLogicUltimate","z":"97aba0f8a5c773f2","name":"","filtertrue":"onlytrue","persist":true,"sInitializeWith":"true","triggertopic":"Pushbutton","outputtriggeredby":"onlyonetopic","inputCount":2,"topic":"result","restrictinputevaluation":false,"delayEvaluation":"","x":780,"y":1960,"wires":[["cd9244ea.471b78"],[],[]]},{"id":"9318320b.670af8","type":"inject","z":"97aba0f8a5c773f2","name":"","repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"Pushbutton","payload":"true","payloadType":"bool","x":560,"y":1960,"wires":[["53a10a7a.cf1894"]]},{"id":"20a981b9.552b4e","type":"inject","z":"97aba0f8a5c773f2","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"IsNight","payload":"true","payloadType":"bool","x":550,"y":2060,"wires":[["53a10a7a.cf1894"]]},{"id":"da0dff55.d7888","type":"inject","z":"97aba0f8a5c773f2","name":"","repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"IsNight","payload":"false","payloadType":"bool","x":550,"y":2100,"wires":[["53a10a7a.cf1894"]]},{"id":"7129d101.1fb7d8","type":"comment","z":"97aba0f8a5c773f2","name":"Pushbutton to switch on light stairs, only if it's night.","info":"","x":650,"y":1920,"wires":[]},{"id":"cd9244ea.471b78","type":"debug","z":"97aba0f8a5c773f2","name":"Temporized Stairs Lightbulb","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":1020,"y":1960,"wires":[]},{"id":"ad5a62a1.7ad81","type":"comment","z":"97aba0f8a5c773f2","name":"Brightness sensor","info":"","x":550,"y":2020,"wires":[]},{"id":"5383d88d1d5d530d","type":"BooleanLogic","z":"97aba0f8a5c773f2","name":"","operation":"AND","inputCount":2,"topic":"result","x":700,"y":2320,"wires":[["5df037ee107a7acf"]]},{"id":"4ab270bf3a44ec31","type":"inject","z":"97aba0f8a5c773f2","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"result1","payload":"true","payloadType":"bool","x":480,"y":2240,"wires":[["5383d88d1d5d530d"]]},{"id":"7a99739b213a5ac8","type":"inject","z":"97aba0f8a5c773f2","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"result2","payload":"true","payloadType":"bool","x":460,"y":2340,"wires":[["5383d88d1d5d530d"]]},{"id":"5df037ee107a7acf","type":"debug","z":"97aba0f8a5c773f2","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":950,"y":2320,"wires":[]},{"id":"d9e9a8db05c94356","type":"inject","z":"97aba0f8a5c773f2","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"result3","payload":"false","payloadType":"bool","x":510,"y":2420,"wires":[["5383d88d1d5d530d"]]},{"id":"aa455a1b3bf9264b","type":"debug","z":"97aba0f8a5c773f2","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":1010,"y":1020,"wires":[]},{"id":"fa3c7b0d9406ed87","type":"debug","z":"97aba0f8a5c773f2","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":1270,"y":960,"wires":[]},{"id":"b3af0667151c5323","type":"BooleanLogic","z":"97aba0f8a5c773f2","name":"","operation":"AND","inputCount":"3","topic":"result","x":700,"y":600,"wires":[["ab2822c5af8e9be3","44e19f0fddf97128","9992bd12ed5174ca"]]},{"id":"ab2822c5af8e9be3","type":"api-call-service","z":"97aba0f8a5c773f2","name":"","server":"","version":5,"debugenabled":false,"domain":"notify","service":"mobile_app_fig_lx1","areaId":[],"deviceId":[],"entityId":[],"data":"{\t \"title\": \"Switch called\",\t \"message\": \"PC turned off\"\t\t}","dataType":"jsonata","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":1130,"y":580,"wires":[[]]},{"id":"8d7126c1f5859f71","type":"change","z":"97aba0f8a5c773f2","name":"","rules":[{"t":"change","p":"payload","pt":"msg","from":"unavailable","fromt":"str","to":"true","tot":"bool"},{"t":"set","p":"topic","pt":"msg","to":"sleep_mode_on_topic2","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":500,"y":640,"wires":[["b3af0667151c5323"]]},{"id":"47c255c08ad3e8e1","type":"debug","z":"97aba0f8a5c773f2","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":230,"y":580,"wires":[]},{"id":"4e32f13f9aa2f759","type":"debug","z":"97aba0f8a5c773f2","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":930,"y":420,"wires":[]},{"id":"850e15b43e5132c7","type":"time-range-switch","z":"97aba0f8a5c773f2","name":"","lat":"","lon":"","startTime":"06:00","endTime":"13:00","startOffset":0,"endOffset":0,"x":810,"y":1080,"wires":[["3e0a95c373fbc42b","afa3d74796a04646"],[]]},{"id":"44e19f0fddf97128","type":"delay","z":"97aba0f8a5c773f2","name":"","pauseType":"delay","timeout":"60","timeoutUnits":"seconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"allowrate":false,"outputs":1,"x":920,"y":660,"wires":[["7a64fcef3c317b61"]]},{"id":"9992bd12ed5174ca","type":"debug","z":"97aba0f8a5c773f2","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":890,"y":560,"wires":[]},{"id":"0cea5219ae66f3a2","type":"change","z":"97aba0f8a5c773f2","name":"","rules":[{"t":"change","p":"payload","pt":"msg","from":"on","fromt":"str","to":"true","tot":"bool"},{"t":"set","p":"topic","pt":"msg","to":"sleep_mode_on_topic3","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":500,"y":580,"wires":[["b3af0667151c5323"]]}]**