[{"id":"889584e17e063dd0","type":"trigger-state","z":"120358abd7c22d30","name":"","server":"","version":4,"inputs":0,"outputs":2,"exposeAsEntityConfig":"","entityId":"input_boolean\\.alarm_finestra.*","entityIdType":"regex","debugEnabled":false,"constraints":[{"targetType":"entity_id","targetValue":"input_boolean.alarm_finestra_01","propertyType":"current_state","propertyValue":"new_state.state","comparatorType":"is","comparatorValueDatatype":"str","comparatorValue":"off"},{"targetType":"entity_id","targetValue":"input_boolean.alarm_finestra_02","propertyType":"current_state","propertyValue":"new_state.state","comparatorType":"is","comparatorValueDatatype":"str","comparatorValue":"off"},{"targetType":"entity_id","targetValue":"input_boolean.alarm_finestra_03","propertyType":"current_state","propertyValue":"new_state.state","comparatorType":"is","comparatorValueDatatype":"str","comparatorValue":"off"}],"customOutputs":[],"outputInitially":false,"stateType":"str","enableInput":false,"x":270,"y":5712,"wires":[["9939d8bcee213f99"],["4fc512cfbfe37a1d"]]},{"id":"5124ab1b6d00fe31","type":"comment","z":"120358abd7c22d30","name":"if you had a static number of booleans you could use the conditions ","info":"","x":336,"y":5664,"wires":[]},{"id":"9939d8bcee213f99","type":"change","z":"120358abd7c22d30","name":"all off","rules":[{"t":"set","p":"alarm.alarm","pt":"flow","to":"true","tot":"bool"}],"action":"","property":"","from":"","to":"","reg":false,"x":530,"y":5712,"wires":[[]]},{"id":"4fc512cfbfe37a1d","type":"change","z":"120358abd7c22d30","name":"at least one on","rules":[{"t":"set","p":"alarm.alarm","pt":"flow","to":"true","tot":"bool"}],"action":"","property":"","from":"","to":"","reg":false,"x":560,"y":5760,"wires":[[]]},{"id":"2070a49c499861ee","type":"server-state-changed","z":"120358abd7c22d30","name":"","server":"","version":5,"outputs":2,"exposeAsEntityConfig":"","entityId":"input_boolean\\.alarm_finestra.*","entityIdType":"regex","outputInitially":false,"stateType":"str","ifState":"on","ifStateType":"str","ifStateOperator":"is","outputOnlyOnStateChange":true,"for":"0","forType":"num","forUnits":"minutes","ignorePrevStateNull":false,"ignorePrevStateUnknown":false,"ignorePrevStateUnavailable":false,"ignoreCurrentStateUnknown":false,"ignoreCurrentStateUnavailable":false,"outputProperties":[],"x":280,"y":5856,"wires":[["f00151f2cb8e9112"],["a9c2a0a9d4aec53c"]]},{"id":"ef36099b27836651","type":"comment","z":"120358abd7c22d30","name":"example 2","info":"","x":156,"y":5808,"wires":[]},{"id":"f00151f2cb8e9112","type":"change","z":"120358abd7c22d30","name":"at least one on","rules":[{"t":"set","p":"alarm.alarm","pt":"flow","to":"true","tot":"bool"}],"action":"","property":"","from":"","to":"","reg":false,"x":576,"y":5856,"wires":[[]]},{"id":"a9c2a0a9d4aec53c","type":"ha-get-entities","z":"120358abd7c22d30","name":"get total","server":"","version":0,"rules":[{"property":"entity_id","logic":"is","value":"input_boolean\\.alarm_finestra.*","valueType":"re"}],"output_type":"count","output_empty_results":false,"output_location_type":"msg","output_location":"total","output_results_count":1,"x":560,"y":5904,"wires":[["45bb05c4c5781964"]]},{"id":"45bb05c4c5781964","type":"ha-get-entities","z":"120358abd7c22d30","name":"get off count","server":"","version":0,"rules":[{"property":"entity_id","logic":"is","value":"input_boolean\\.alarm_finestra.*","valueType":"re"},{"property":"state","logic":"is","value":"off","valueType":"str"}],"output_type":"count","output_empty_results":false,"output_location_type":"msg","output_location":"count","output_results_count":1,"x":718,"y":5904,"wires":[["645688667179a3fd"]]},{"id":"645688667179a3fd","type":"switch","z":"120358abd7c22d30","name":"all off?","property":"total","propertyType":"msg","rules":[{"t":"eq","v":"count","vt":"msg"}],"checkall":"true","repair":false,"outputs":1,"x":866,"y":5904,"wires":[["986b6d6b0c6cc534"]]},{"id":"986b6d6b0c6cc534","type":"change","z":"120358abd7c22d30","name":"all off","rules":[{"t":"set","p":"alarm.alarm","pt":"flow","to":"true","tot":"bool"}],"action":"","property":"","from":"","to":"","reg":false,"x":990,"y":5904,"wires":[[]]}]