Bonjour à tous
Et bonne fête à tous les « PAPA »
Je souhaite savoir comment modifier le code suivant
Idéalement je souhaite avoir des variables pour les heures le matin et le soir, mais je seches ou dois-je passer par un noeud fonction mais @golfvert disait qu’il était pas fait pour ce type de flow (plus lent)
[{"id":"fc23c5de6e8a71c7","type":"comment","z":"1ca572c6b1d47669","name":"Couloir Entrée - Allumage Mvt","info":"","x":200,"y":880,"wires":[]},{"id":"285085a952d4d5a0","type":"trigger-state","z":"1ca572c6b1d47669","name":"Détection Oeil Couloir","server":"4066b510aa00d654","version":4,"inputs":1,"outputs":4,"exposeAsEntityConfig":"","entityId":"binary_sensor.capt_couloir_occupancy","entityIdType":"exact","debugEnabled":false,"constraints":[{"targetType":"this_entity","targetValue":"","propertyType":"current_state","propertyValue":"new_state.state","comparatorType":"is_not","comparatorValueDatatype":"prevEntity","comparatorValue":"state"}],"customOutputs":[{"messageType":"default","messageValue":"","messageValueType":"json","comparatorPropertyType":"current_state","comparatorPropertyValue":"new_state.state","comparatorType":"is","comparatorValue":"on","comparatorValueDataType":"str"},{"messageType":"default","messageValue":"","messageValueType":"json","comparatorPropertyType":"current_state","comparatorPropertyValue":"new_state.state","comparatorType":"is","comparatorValue":"off","comparatorValueDataType":"str"}],"outputInitially":false,"stateType":"str","enableInput":true,"exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"x":200,"y":980,"wires":[[],[],["744a1b7cd98e4bd3"],["4c9513ae5550f830"]]},{"id":"744a1b7cd98e4bd3","type":"chronos-filter","z":"1ca572c6b1d47669","name":"06:40 - 07:30 / sunset - 22:30","config":"a36028443f503b53","baseTime":"","baseTimeType":"msgIngress","evaluation":"","evaluationType":"or","conditions":[{"operator":"between","operands":[{"type":"time","value":"06:40","offset":0,"random":false},{"type":"time","value":"07:30","offset":0,"random":false}]},{"operator":"between","operands":[{"type":"sun","value":"sunsetStart","offset":0,"random":false},{"type":"time","value":"22:30","offset":0,"random":false}]}],"x":500,"y":920,"wires":[["e5c19ca414b5a70c"]]},{"id":"2f496fee79ab0553","type":"api-call-service","z":"1ca572c6b1d47669","name":"Couloir spot on","server":"4066b510aa00d654","version":5,"debugenabled":false,"domain":"switch","service":"turn_on","areaId":[],"deviceId":[],"entityId":["switch.couloir_entree"],"data":"","dataType":"jsonata","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":980,"y":920,"wires":[[]]},{"id":"e5c19ca414b5a70c","type":"function","z":"1ca572c6b1d47669","name":"de juin à sept rien le matin","func":"const now = new Date();\nconst day = now.getDay();\nconst month = now.getMonth();\n\n// Les mois sont de 0 (janvier) à 11 (décembre)\nconst isJuneToSeptember = month >= 5 && month <= 8;\nconst isWeekend = day === 0 || day === 6; // 0 pour dimanche, 6 pour samedi\n\nif (isJuneToSeptember && isWeekend && now.getHours() >= 6 && now.getHours() < 12) {\n // Ne rien faire le matin (entre 06:00 et 12:00) les week-ends de juin à septembre\n return null;\n}\n\n// Continuer le flux normalement\nreturn msg;","outputs":1,"timeout":"","noerr":0,"initialize":"","finalize":"","libs":[],"x":750,"y":920,"wires":[["2f496fee79ab0553"]]},{"id":"4c9513ae5550f830","type":"api-call-service","z":"1ca572c6b1d47669","name":"Couloir spot off","server":"4066b510aa00d654","version":5,"debugenabled":false,"domain":"switch","service":"turn_off","areaId":[],"deviceId":[],"entityId":["switch.couloir_entree"],"data":"","dataType":"jsonata","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":980,"y":1000,"wires":[[]]},{"id":"4066b510aa00d654","type":"server","name":"HA","version":5,"addon":false,"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":": ","statusYear":"hidden","statusMonth":"short","statusDay":"numeric","statusHourCycle":"default","statusTimeFormat":"h:m","enableGlobalContextStore":false},{"id":"a36028443f503b53","type":"chronos-config","name":"timecontrol","timezone":"","sunPositions":[]}]
Merci d’avance