diff --git a/.claude/settings.local.json b/.claude/settings.local.json index 6f4e822..cad342e 100644 --- a/.claude/settings.local.json +++ b/.claude/settings.local.json @@ -4,7 +4,9 @@ "Bash(python3 -c \"import json,sys; data=json.load\\(sys.stdin\\); print\\(type\\(data\\)\\); print\\(len\\(data\\) if isinstance\\(data, list\\) else 'not list'\\); print\\([n.get\\('type'\\) for n in data[:20]] if isinstance\\(data, list\\) else ''\\)\")", "Bash(ls:*)", "Bash(sed -i '/^ on_click:$/{ n; /^ min_length:.*$/d }' \"C:/Users/jkocon/Documents/Gitea/ESP32-Hub/kuba-hub.yaml\")", - "Bash(sed -i '/^ on_click:$/{ n; /^ max_length:.*$/d }' \"C:/Users/jkocon/Documents/Gitea/ESP32-Hub/kuba-hub.yaml\")" + "Bash(sed -i '/^ on_click:$/{ n; /^ max_length:.*$/d }' \"C:/Users/jkocon/Documents/Gitea/ESP32-Hub/kuba-hub.yaml\")", + "Bash(node -e ':*)", + "Bash(python3 *)" ] } } diff --git a/Kuba/flow_results_detailed.json b/Kuba/flow_results_detailed.json new file mode 100644 index 0000000..7dd1ffd --- /dev/null +++ b/Kuba/flow_results_detailed.json @@ -0,0 +1,559 @@ +[ + { + "entity_id": "binary_sensor.hub1_in0", + "friendly_name": "Włącznik Wejście 1", + "actions": { + "single": [ + "light.main_hub_hub1_out15" + ], + "long": [ + "all" + ] + }, + "controls": [ + "all", + "light.main_hub_hub1_out15" + ] + }, + { + "entity_id": "binary_sensor.hub1_in2", + "friendly_name": "Włącznik Wejście 3", + "actions": { + "single": [ + "light.korytarz_kinkiety" + ], + "long": [ + "all" + ] + }, + "controls": [ + "all", + "light.korytarz_kinkiety" + ] + }, + { + "entity_id": "binary_sensor.hub1_in3", + "friendly_name": "Sypialnia duża 3", + "actions": { + "single": [ + "light.main_hub_hub2_out12", + "light.main_hub_hub2_out1" + ], + "double": [ + "light.main_hub_hub2_out12", + "light.main_hub_hub2_out1" + ] + }, + "controls": [ + "light.main_hub_hub2_out1", + "light.main_hub_hub2_out12" + ] + }, + { + "entity_id": "binary_sensor.hub1_in4", + "friendly_name": "Sypialnia duża 1", + "actions": { + "single": [ + "light.main_hub_sypialnia_led" + ], + "double": [ + "light.main_hub_sypialnia_led" + ] + }, + "controls": [ + "light.main_hub_sypialnia_led" + ] + }, + { + "entity_id": "binary_sensor.hub1_in5", + "friendly_name": "Sypialnia duża 2", + "actions": { + "single": [ + "light.main_hub_hub2_out7" + ] + }, + "controls": [ + "light.main_hub_hub2_out7" + ] + }, + { + "entity_id": "binary_sensor.hub1_in6", + "friendly_name": "Sypialnia Łóżko prawo", + "actions": { + "single": [ + "light.main_hub_hub2_out1" + ], + "double": [ + "light.main_hub_hub2_out12", + "light.main_hub_hub2_out1" + ], + "long": [ + "all" + ] + }, + "controls": [ + "all", + "light.main_hub_hub2_out1", + "light.main_hub_hub2_out12" + ] + }, + { + "entity_id": "binary_sensor.hub1_in7", + "friendly_name": "Sypialnia Łóżko lewo", + "actions": { + "single": [ + "light.main_hub_hub2_out12" + ], + "double": [ + "light.main_hub_hub2_out12", + "light.main_hub_hub2_out1" + ], + "long": [ + "all" + ] + }, + "controls": [ + "all", + "light.main_hub_hub2_out1", + "light.main_hub_hub2_out12" + ] + }, + { + "entity_id": "binary_sensor.hub1_in8", + "friendly_name": "Sypialnia mała 2", + "actions": { + "single": [ + "light.main_hub_hub2_out10" + ], + "double": [ + "light.main_hub_hub1_out7" + ] + }, + "controls": [ + "light.main_hub_hub1_out7", + "light.main_hub_hub2_out10" + ] + }, + { + "entity_id": "binary_sensor.hub1_in9", + "friendly_name": "Sypialnia mała 1", + "actions": { + "default": [ + "light.main_hub_pokoj_dla_gosci_led" + ] + }, + "controls": [ + "light.main_hub_pokoj_dla_gosci_led" + ] + }, + { + "entity_id": "binary_sensor.hub2_in0", + "friendly_name": "Włącznik Korytarz 2", + "actions": { + "single": [ + "light.main_hub_hub1_out15" + ] + }, + "controls": [ + "light.main_hub_hub1_out15" + ] + }, + { + "entity_id": "binary_sensor.hub2_in1", + "friendly_name": "Włącznik Korytarz 3", + "actions": { + "single": [ + "light.korytarz_kinkiety" + ], + "long": [ + "all" + ] + }, + "controls": [ + "all", + "light.korytarz_kinkiety" + ] + }, + { + "entity_id": "binary_sensor.hub2_in10", + "friendly_name": "Filar 1_2", + "actions": { + "single": [ + "light.komin_led", + "light.salon_kinkiety_led" + ], + "double": [ + "light.komin_led" + ], + "long": [ + "light.komin_led" + ] + }, + "controls": [ + "light.komin_led", + "light.salon_kinkiety_led" + ] + }, + { + "entity_id": "binary_sensor.hub2_in11", + "friendly_name": "Salon 3", + "actions": { + "single": [ + "light.oczka_taras_2", + "light.skrzynia_2", + "light.tunel_2", + "light.zwis_schody_2" + ] + }, + "controls": [ + "light.oczka_taras_2", + "light.skrzynia_2", + "light.tunel_2", + "light.zwis_schody_2" + ] + }, + { + "entity_id": "binary_sensor.hub2_in12", + "friendly_name": "Salon 1", + "actions": { + "single": [ + "light.main_hub_hub2_out11" + ] + }, + "controls": [ + "light.main_hub_hub2_out11" + ] + }, + { + "entity_id": "binary_sensor.hub2_in13", + "friendly_name": "Salon 2", + "actions": { + "single": [ + "light.salon_kinkiet_1_led", + "light.salon_kinkiet_2_led", + "light.salon_kinkiet_3_led" + ], + "double": [ + "light.salon_kinkiety_led", + "light.salon_kinkiet_1_led", + "light.salon_kinkiet_2_led", + "light.salon_kinkiet_3_led" + ], + "long": [ + "light.komin_led" + ] + }, + "controls": [ + "light.komin_led", + "light.salon_kinkiet_1_led", + "light.salon_kinkiet_2_led", + "light.salon_kinkiet_3_led", + "light.salon_kinkiety_led" + ] + }, + { + "entity_id": "binary_sensor.hub2_in2", + "friendly_name": "Włącznik Korytarz 1", + "actions": { + "single": [ + "light.main_hub_hub1_out14" + ], + "long": [ + "all" + ] + }, + "controls": [ + "all", + "light.main_hub_hub1_out14" + ] + }, + { + "entity_id": "binary_sensor.hub2_in3", + "friendly_name": "Włącznik Korytarz maŲ�y", + "actions": { + "single": [], + "double": [] + }, + "controls": [ + "light.main_hub_hub1_out13", + "light.main_hub_hub2_out3" + ] + }, + { + "entity_id": "binary_sensor.hub2_in4", + "friendly_name": "Włącznik Garderoba mała", + "actions": { + "single": [ + "light.main_hub_hub2_out14" + ], + "double": [ + "fan.main_hub_hub3_out2" + ] + }, + "controls": [ + "fan.main_hub_hub3_out2", + "light.main_hub_hub2_out14" + ] + }, + { + "entity_id": "binary_sensor.hub2_in5", + "friendly_name": "Filar 3_1", + "actions": { + "single": [ + "light.main_hub_hub1_out8" + ] + }, + "controls": [ + "light.main_hub_hub1_out8" + ] + }, + { + "entity_id": "binary_sensor.hub2_in6", + "friendly_name": "Filar 3_2", + "actions": { + "single": [ + "light.main_hub_jadalnia_led" + ] + }, + "controls": [ + "light.main_hub_jadalnia_led" + ] + }, + { + "entity_id": "binary_sensor.hub2_in7", + "friendly_name": "Filar 2_1", + "actions": { + "single": [ + "light.main_hub_hub1_out3" + ], + "long": [ + "all" + ] + }, + "controls": [ + "all", + "light.main_hub_hub1_out3" + ] + }, + { + "entity_id": "binary_sensor.hub2_in8", + "friendly_name": "Filar 2_2", + "actions": { + "single": [ + "light.main_hub_kuchnia_lezka_led" + ] + }, + "controls": [ + "light.main_hub_kuchnia_lezka_led" + ] + }, + { + "entity_id": "binary_sensor.hub2_in9", + "friendly_name": "Filar 1_1", + "actions": { + "single": [ + "light.main_hub_hub2_out11" + ], + "double": [ + "fan.salon_wentylator" + ] + }, + "controls": [ + "fan.salon_wentylator", + "light.main_hub_hub2_out11" + ] + }, + { + "entity_id": "binary_sensor.hub3_in0", + "friendly_name": "Włącznik Garderoba mała", + "actions": { + "single": [ + "light.main_hub_hub1_out7" + ] + }, + "controls": [ + "light.main_hub_hub1_out7" + ] + }, + { + "entity_id": "binary_sensor.hub3_in1", + "friendly_name": "Włącznik Garderoba mała", + "actions": { + "default": [] + }, + "controls": [] + }, + { + "entity_id": "binary_sensor.hub3_in10", + "friendly_name": "Biuro", + "actions": { + "single": [ + "light.main_hub_hub1_out2" + ], + "double": [ + "light.main_hub_serwer_led" + ] + }, + "controls": [ + "light.main_hub_hub1_out2", + "light.main_hub_serwer_led" + ] + }, + { + "entity_id": "binary_sensor.hub3_in11", + "friendly_name": "Włącznik obok serwera", + "actions": { + "single": [ + "light.main_hub_serwer_led" + ], + "double": [ + "light.test_led_2" + ], + "triple": [ + "fan.main_hub_hub3_out2" + ] + }, + "controls": [ + "fan.main_hub_hub3_out2", + "light.main_hub_serwer_led", + "light.test_led_2" + ] + }, + { + "entity_id": "binary_sensor.hub3_in12", + "friendly_name": "Włącznik obok serwera", + "actions": { + "single": [ + "light.main_hub_hub1_out14" + ], + "double": [ + "light.main_hub_hub1_out14" + ], + "long": [ + "all" + ] + }, + "controls": [ + "all", + "light.main_hub_hub1_out14", + "light.main_hub_hub1_out2" + ] + }, + { + "entity_id": "binary_sensor.hub3_in2", + "friendly_name": "SPA Lewy", + "actions": { + "single": [ + "light.main_hub_hub2_out13" + ], + "long": [ + "fan.main_hub_hub1_out4" + ] + }, + "controls": [ + "fan.main_hub_hub1_out4", + "light.main_hub_hub2_out13" + ] + }, + { + "entity_id": "binary_sensor.hub3_in3", + "friendly_name": "SPA Prawy", + "actions": { + "single": [ + "fan.main_hub_hub1_out4" + ], + "long": [ + "light.main_hub_spa_ledy" + ] + }, + "controls": [ + "fan.main_hub_hub1_out4", + "light.main_hub_hub1_out10", + "light.main_hub_spa_ledy" + ] + }, + { + "entity_id": "binary_sensor.hub3_in4", + "friendly_name": "Włącznik Biała łazienka plafon", + "actions": { + "single": [ + "light.main_hub_hub2_out0" + ], + "double": [ + "light.main_hub_biala_lazienka_wanna_led" + ], + "long": [ + "fan.main_hub_hub2_out8" + ] + }, + "controls": [ + "fan.main_hub_hub2_out8", + "light.main_hub_biala_lazienka_wanna_led", + "light.main_hub_hub2_out0" + ] + }, + { + "entity_id": "binary_sensor.hub3_in5", + "friendly_name": "WC Prawy", + "actions": { + "default": [ + "fan.main_hub_hub2_out5", + "light.main_hub_hub2_out2", + "light.wc_led" + ] + }, + "controls": [ + "fan.main_hub_hub2_out5", + "light.main_hub_hub2_out2", + "light.wc_led" + ] + }, + { + "entity_id": "binary_sensor.hub3_in6", + "friendly_name": "WC Lewy", + "actions": { + "default": [ + "light.main_hub_hub1_out9" + ] + }, + "controls": [ + "light.main_hub_hub1_out9" + ] + }, + { + "entity_id": "binary_sensor.hub3_in7", + "friendly_name": "Włącznik Biała łazienka skos", + "actions": { + "single": [ + "light.main_hub_hub2_out4" + ] + }, + "controls": [ + "light.main_hub_hub2_out4" + ] + }, + { + "entity_id": "binary_sensor.hub3_in8", + "friendly_name": "SPA Prawy", + "actions": { + "single": [ + "light.main_hub_hub1_out5" + ] + }, + "controls": [ + "light.main_hub_hub1_out5" + ] + }, + { + "entity_id": "binary_sensor.hub3_in9", + "friendly_name": "SPA Prawy", + "actions": { + "single": [ + "light.main_hub_hub1_out1" + ] + }, + "controls": [ + "light.main_hub_hub1_out1" + ] + } +] \ No newline at end of file diff --git a/Kuba/main-hub.yaml b/Kuba/main-hub_do zrobienia.yaml similarity index 58% rename from Kuba/main-hub.yaml rename to Kuba/main-hub_do zrobienia.yaml index 34ca2e8..a4034bb 100644 --- a/Kuba/main-hub.yaml +++ b/Kuba/main-hub_do zrobienia.yaml @@ -1,6 +1,15 @@ -esphome: +substitutions: name: main-hub - friendly_name: main-hub + friendly_name: 'Main Hub' + project_version: '1.1' + +esphome: + name: '${name}' + friendly_name: '${friendly_name}' + name_add_mac_suffix: false + project: + name: peakcontrol.main-hub + version: '${project_version}' esp32: board: esp32dev @@ -9,15 +18,33 @@ esp32: # Enable logging logger: + level: WARN # Enable Home Assistant API api: encryption: - key: "eyBNZWDUaBDCTIZsSIUzwHFpUcm/Kbc9UAWjX++ToL4=" + key: !secret api_key + on_client_connected: + - light.turn_on: + id: status_led + red: 0% + green: 100% + blue: 0% + brightness: 50% + on_client_disconnected: + - light.turn_on: + id: status_led + red: 100% + green: 0% + blue: 0% + brightness: 100% + effect: "Slow Pulse" ota: - platform: esphome - password: "000f95472f1adc514d45abdc280a3903" + password: !secret ota_key + - platform: web_server + #wifi: # ssid: !secret wifi_ssid @@ -32,6 +59,9 @@ ota: web_server: port: 80 + auth: + username: admin + password: !secret web_password ethernet: type: LAN8720 @@ -40,10 +70,14 @@ ethernet: clk_mode: GPIO17_OUT phy_addr: 0 power_pin: GPIO12 + manual_ip: + static_ip: 10.10.0.5 + gateway: 10.10.0.1 + subnet: 255.255.255.0 button: - platform: restart - name: "main-hub Restart" + name: '${friendly_name} Restart' i2c: sda: 13 @@ -192,6 +226,7 @@ output: light: - platform: rgb name: "Status LED" + id: status_led red: output_red green: output_green blue: output_blue @@ -211,6 +246,7 @@ light: #LEDY przez PCSA9685 - platform: cwww name: "Serwer LED" + id: serwer_led cold_white: PWM2_1_Hub1 warm_white: PWM2_2_Hub1 cold_white_color_temperature: 6536 K @@ -218,6 +254,7 @@ light: default_transition_length: 2.0s - platform: cwww name: "Jadalnia LED" + id: jadalnia_led cold_white: PWM4_2_Hub1 warm_white: PWM4_1_Hub1 cold_white_color_temperature: 6536 K @@ -225,6 +262,7 @@ light: default_transition_length: 2.0s - platform: cwww name: "Biała Łazienka wanna LED" + id: biala_lazienka_wanna_led cold_white: PWM5_2_Hub1 warm_white: PWM5_1_Hub1 cold_white_color_temperature: 6536 K @@ -232,6 +270,7 @@ light: default_transition_length: 2.0s - platform: monochromatic name: "Kuchnia Łezka LED" + id: kuchnia_lezka_led output: PWM2_1_Hub2 default_transition_length: 2.0s - platform: cwww @@ -244,6 +283,7 @@ light: default_transition_length: 2.0s - platform: cwww name: "Pokój dla gości LED" + id: pokoj_dla_gosci_led cold_white: PWM3_2_Hub2 warm_white: PWM4_1_Hub2 cold_white_color_temperature: 6536 K @@ -254,9 +294,11 @@ light: output: PWM1_2_Hub2 - platform: monochromatic name: "TEST LED 2" + id: test_led_2 output: PWM3_1_Hub2 - platform: rgbww name: "Sypialnia LED" + id: sypialnia_led red: PWM1_1_Hub1 green: PWM1_2_Hub1 blue: PWM3_1_Hub1 @@ -267,6 +309,11 @@ light: color_interlock: false default_transition_length: 2.0s +time: + - platform: homeassistant + timezone: Europe/Warsaw + id: ha_time + esp32_ble_tracker: switch: @@ -706,6 +753,43 @@ switch: id: hub3_out15 restore_mode: ALWAYS_OFF +script: + - id: off_all + then: + - switch.turn_off: hub1_out1 + - switch.turn_off: hub1_out2 + - switch.turn_off: hub1_out3 + - switch.turn_off: hub1_out4 + - switch.turn_off: hub1_out5 + - switch.turn_off: hub1_out7 + - switch.turn_off: hub1_out8 + - switch.turn_off: hub1_out9 + - switch.turn_off: hub1_out10 + - switch.turn_off: hub1_out13 + - switch.turn_off: hub1_out14 + - switch.turn_off: hub1_out15 + - switch.turn_off: hub2_out0 + - switch.turn_off: hub2_out1 + - switch.turn_off: hub2_out2 + - switch.turn_off: hub2_out3 + - switch.turn_off: hub2_out4 + - switch.turn_off: hub2_out5 + - switch.turn_off: hub2_out7 + - switch.turn_off: hub2_out8 + - switch.turn_off: hub2_out10 + - switch.turn_off: hub2_out11 + - switch.turn_off: hub2_out12 + - switch.turn_off: hub2_out13 + - switch.turn_off: hub2_out14 + - switch.turn_off: hub3_out2 + - light.turn_off: serwer_led + - light.turn_off: jadalnia_led + - light.turn_off: biala_lazienka_wanna_led + - light.turn_off: kuchnia_lezka_led + - light.turn_off: SPA_Ledy + - light.turn_off: pokoj_dla_gosci_led + - light.turn_off: sypialnia_led + binary_sensor: #Mains detector #- platform: gpio @@ -723,7 +807,19 @@ binary_sensor: number: 0 mode: INPUT inverted: True + filters: + - delayed_on_off: 30ms id: hub1_in0 + on_multi_click: + - timing: + - ON for at most 350ms + - OFF for at least 350ms + then: + - switch.toggle: hub1_out15 # Wejście Halogeny + - timing: + - ON for at least 350ms + then: + - script.execute: off_all - platform: gpio name: "hub1_in1" # Wejście 3 pin: @@ -731,6 +827,8 @@ binary_sensor: number: 1 mode: INPUT inverted: True + filters: + - delayed_on_off: 30ms id: hub1_in1 - platform: gpio name: "hub1_in2" # Wejście 2 @@ -739,7 +837,22 @@ binary_sensor: number: 2 mode: INPUT inverted: True + filters: + - delayed_on_off: 30ms id: hub1_in2 + on_multi_click: + - timing: + - ON for at most 350ms + - OFF for at least 350ms + then: + - homeassistant.service: + service: light.toggle + data: + entity_id: light.korytarz_kinkiety # Korytarz Kinkiety + - timing: + - ON for at least 350ms + then: + - script.execute: off_all - platform: gpio name: "hub1_in3" # Sypialnia 3 pin: @@ -747,7 +860,24 @@ binary_sensor: number: 3 mode: INPUT inverted: True + filters: + - delayed_on_off: 30ms id: hub1_in3 + on_multi_click: + - timing: + - ON for at most 350ms + - OFF for at least 350ms + then: + - switch.toggle: hub2_out12 # Sypialnia Łóżko Lewa strona + - switch.toggle: hub2_out1 # Sypialnia Łóżko Prawa strona + - timing: + - ON for at most 350ms + - OFF for at most 350ms + - ON for at most 350ms + - OFF for at least 350ms + then: + - switch.toggle: hub2_out12 # Sypialnia Łóżko Lewa strona + - switch.toggle: hub2_out1 # Sypialnia Łóżko Prawa strona - platform: gpio name: "hub1_in4" # Sypialnia 1 pin: @@ -755,7 +885,15 @@ binary_sensor: number: 4 mode: INPUT inverted: True + filters: + - delayed_on_off: 30ms id: hub1_in4 + on_multi_click: + - timing: + - ON for at most 350ms + - OFF for at least 350ms + then: + - light.toggle: sypialnia_led # Sypialnia LED - platform: gpio name: "hub1_in5" # Sypialnia 2 pin: @@ -763,7 +901,15 @@ binary_sensor: number: 5 mode: INPUT inverted: True + filters: + - delayed_on_off: 30ms id: hub1_in5 + on_multi_click: + - timing: + - ON for at most 350ms + - OFF for at least 350ms + then: + - switch.toggle: hub2_out7 # Sypialnia Halogen - platform: gpio name: "hub1_in6" # Sypialnia Łóżko Prawa Strona pin: @@ -771,7 +917,27 @@ binary_sensor: number: 6 mode: INPUT inverted: True + filters: + - delayed_on_off: 30ms id: hub1_in6 + on_multi_click: + - timing: + - ON for at most 350ms + - OFF for at least 350ms + then: + - switch.toggle: hub2_out1 # Sypialnia Łóżko Prawa strona + - timing: + - ON for at most 350ms + - OFF for at most 350ms + - ON for at most 350ms + - OFF for at least 350ms + then: + - switch.toggle: hub2_out12 # Sypialnia Łóżko Lewa strona + - switch.toggle: hub2_out1 # Sypialnia Łóżko Prawa strona + - timing: + - ON for at least 350ms + then: + - script.execute: off_all - platform: gpio name: "hub1_in7" # Sypialnia Łóżko Lewa Strona pin: @@ -779,23 +945,66 @@ binary_sensor: number: 7 mode: INPUT inverted: True + filters: + - delayed_on_off: 30ms id: hub1_in7 + on_multi_click: + - timing: + - ON for at most 350ms + - OFF for at least 350ms + then: + - switch.toggle: hub2_out12 # Sypialnia Łóżko Lewa strona + - timing: + - ON for at most 350ms + - OFF for at most 350ms + - ON for at most 350ms + - OFF for at least 350ms + then: + - switch.toggle: hub2_out12 # Sypialnia Łóżko Lewa strona + - switch.toggle: hub2_out1 # Sypialnia Łóżko Prawa strona + - timing: + - ON for at least 350ms + then: + - script.execute: off_all - platform: gpio - name: "hub1_in8" # Niebieski Pokój Lewy + name: "hub1_in8" # Pokój dla Gości Lewy pin: mcp23xxx: mcp23xxx_hub1_IN number: 8 mode: INPUT inverted: True + filters: + - delayed_on_off: 30ms id: hub1_in8 + on_multi_click: + - timing: + - ON for at most 350ms + - OFF for at least 350ms + then: + - switch.toggle: hub2_out10 # Pokój Gościnny Sufit + - timing: + - ON for at most 350ms + - OFF for at most 350ms + - ON for at most 350ms + - OFF for at least 350ms + then: + - switch.toggle: hub1_out7 # Garderoba Duża - platform: gpio - name: "hub1_in9" # Niebieski Pokój Prawy + name: "hub1_in9" # Pokój dla Gości Prawy pin: mcp23xxx: mcp23xxx_hub1_IN number: 9 mode: INPUT inverted: True + filters: + - delayed_on_off: 30ms id: hub1_in9 + on_multi_click: + - timing: + - ON for at most 350ms + - OFF for at least 350ms + then: + - light.toggle: pokoj_dla_gosci_led # Pokój dla Gości LED - platform: gpio name: "hub1_in10" # (niepodpięte) pin: @@ -803,6 +1012,8 @@ binary_sensor: number: 10 mode: INPUT inverted: True + filters: + - delayed_on_off: 30ms id: hub1_in10 - platform: gpio name: "hub1_in11" # (niepodpięte) @@ -811,6 +1022,8 @@ binary_sensor: number: 11 mode: INPUT inverted: True + filters: + - delayed_on_off: 30ms id: hub1_in11 - platform: gpio name: "hub1_in12" # (niepodpięte) @@ -819,6 +1032,8 @@ binary_sensor: number: 12 mode: INPUT inverted: True + filters: + - delayed_on_off: 30ms id: hub1_in12 - platform: gpio name: "hub1_in13" # (niepodpięte) @@ -827,6 +1042,8 @@ binary_sensor: number: 13 mode: INPUT inverted: True + filters: + - delayed_on_off: 30ms id: hub1_in13 - platform: gpio name: "hub1_in14" # (niepodpięte) @@ -835,6 +1052,8 @@ binary_sensor: number: 14 mode: INPUT inverted: True + filters: + - delayed_on_off: 30ms id: hub1_in14 - platform: gpio name: "hub1_in15" # (niepodpięte) @@ -843,6 +1062,8 @@ binary_sensor: number: 15 mode: INPUT inverted: True + filters: + - delayed_on_off: 30ms id: hub1_in15 ################## #mcp23xxx_hub2_IN# @@ -854,7 +1075,15 @@ binary_sensor: number: 0 mode: INPUT inverted: True + filters: + - delayed_on_off: 30ms id: hub2_in0 + on_multi_click: + - timing: + - ON for at most 350ms + - OFF for at least 350ms + then: + - switch.toggle: hub1_out15 # Wejście Halogeny - platform: gpio name: "hub2_in1" # Korytarz 3 pin: @@ -862,7 +1091,22 @@ binary_sensor: number: 1 mode: INPUT inverted: True + filters: + - delayed_on_off: 30ms id: hub2_in1 + on_multi_click: + - timing: + - ON for at most 350ms + - OFF for at least 350ms + then: + - homeassistant.service: + service: light.toggle + data: + entity_id: light.korytarz_kinkiety # Korytarz Kinkiety + - timing: + - ON for at least 350ms + then: + - script.execute: off_all - platform: gpio name: "hub2_in2" # Korytarz 1 pin: @@ -870,7 +1114,19 @@ binary_sensor: number: 2 mode: INPUT inverted: True + filters: + - delayed_on_off: 30ms id: hub2_in2 + on_multi_click: + - timing: + - ON for at most 350ms + - OFF for at least 350ms + then: + - switch.toggle: hub1_out14 # Korytarz Halogeny + - timing: + - ON for at least 350ms + then: + - script.execute: off_all - platform: gpio name: "hub2_in3" # Mały Korytarz pin: @@ -878,7 +1134,16 @@ binary_sensor: number: 3 mode: INPUT inverted: True + filters: + - delayed_on_off: 30ms id: hub2_in3 + on_multi_click: + - timing: + - ON for at most 350ms + - OFF for at least 350ms + then: + - switch.toggle: hub1_out13 # Mały Korytarz Kinkiet + - switch.toggle: hub2_out3 # Mały Korytarz Sufit - platform: gpio name: "hub2_in4" # Garderoba Mała pin: @@ -886,7 +1151,22 @@ binary_sensor: number: 4 mode: INPUT inverted: True + filters: + - delayed_on_off: 30ms id: hub2_in4 + on_multi_click: + - timing: + - ON for at most 350ms + - OFF for at least 350ms + then: + - switch.toggle: hub2_out14 # Mała Garderoba + - timing: + - ON for at most 350ms + - OFF for at most 350ms + - ON for at most 350ms + - OFF for at least 350ms + then: + - switch.toggle: hub3_out2 # Wentylator Główny Obieg - platform: gpio name: "hub2_in5" # Kuchnia 3_1 pin: @@ -894,7 +1174,15 @@ binary_sensor: number: 5 mode: INPUT inverted: True + filters: + - delayed_on_off: 30ms id: hub2_in5 + on_multi_click: + - timing: + - ON for at most 350ms + - OFF for at least 350ms + then: + - switch.toggle: hub1_out8 # Jadalnia - platform: gpio name: "hub2_in6" # Kuchnia 3_2 pin: @@ -902,7 +1190,15 @@ binary_sensor: number: 6 mode: INPUT inverted: True + filters: + - delayed_on_off: 30ms id: hub2_in6 + on_multi_click: + - timing: + - ON for at most 350ms + - OFF for at least 350ms + then: + - light.toggle: jadalnia_led # Jadalnia LED - platform: gpio name: "hub2_in7" # Kuchnia 2_1 pin: @@ -910,7 +1206,19 @@ binary_sensor: number: 7 mode: INPUT inverted: True + filters: + - delayed_on_off: 30ms id: hub2_in7 + on_multi_click: + - timing: + - ON for at most 350ms + - OFF for at least 350ms + then: + - switch.toggle: hub1_out3 # Kuchnia Halogen + - timing: + - ON for at least 350ms + then: + - script.execute: off_all - platform: gpio name: "hub2_in8" # Kuchnia 2_2 pin: @@ -918,7 +1226,15 @@ binary_sensor: number: 8 mode: INPUT inverted: True + filters: + - delayed_on_off: 30ms id: hub2_in8 + on_multi_click: + - timing: + - ON for at most 350ms + - OFF for at least 350ms + then: + - light.toggle: kuchnia_lezka_led # Kuchnia Łezka LED - platform: gpio name: "hub2_in9" # Kuchnia 1_1 pin: @@ -926,7 +1242,25 @@ binary_sensor: number: 9 mode: INPUT inverted: True + filters: + - delayed_on_off: 30ms id: hub2_in9 + on_multi_click: + - timing: + - ON for at most 350ms + - OFF for at least 350ms + then: + - switch.toggle: hub2_out11 # Salon Plafon + - timing: + - ON for at most 350ms + - OFF for at most 350ms + - ON for at most 350ms + - OFF for at least 350ms + then: + - homeassistant.service: + service: switch.toggle + data: + entity_id: switch.salon_wentylator # Salon Wentylator - platform: gpio name: "hub2_in10" # Kuchnia 1_2 pin: @@ -934,7 +1268,39 @@ binary_sensor: number: 10 mode: INPUT inverted: True + filters: + - delayed_on_off: 30ms id: hub2_in10 + on_multi_click: + - timing: + - ON for at most 350ms + - OFF for at least 350ms + then: + - homeassistant.service: + service: light.toggle + data: + entity_id: light.komin_led # Komin LED + - homeassistant.service: + service: light.toggle + data: + entity_id: light.salon_kinkiety_led # Salon Kinkiety LED + - timing: + - ON for at most 350ms + - OFF for at most 350ms + - ON for at most 350ms + - OFF for at least 350ms + then: + - homeassistant.service: + service: light.toggle + data: + entity_id: light.komin_led # Komin LED + - timing: + - ON for at least 350ms + then: + - homeassistant.service: + service: light.toggle + data: + entity_id: light.komin_led # Komin LED - platform: gpio name: "hub2_in11" # Schody 3 pin: @@ -942,7 +1308,30 @@ binary_sensor: number: 11 mode: INPUT inverted: True + filters: + - delayed_on_off: 30ms id: hub2_in11 + on_multi_click: + - timing: + - ON for at most 350ms + - OFF for at least 350ms + then: + - homeassistant.service: + service: light.toggle + data: + entity_id: light.oczka_taras_2 # Oczka Taras + - homeassistant.service: + service: light.toggle + data: + entity_id: light.skrzynia_2 # Skrzynia + - homeassistant.service: + service: light.toggle + data: + entity_id: light.tunel_2 # Tunel + - homeassistant.service: + service: light.toggle + data: + entity_id: light.zwis_schody_2 # Zwis Schody - platform: gpio name: "hub2_in12" # Schody 1 pin: @@ -950,7 +1339,15 @@ binary_sensor: number: 12 mode: INPUT inverted: True + filters: + - delayed_on_off: 30ms id: hub2_in12 + on_multi_click: + - timing: + - ON for at most 350ms + - OFF for at least 350ms + then: + - switch.toggle: hub2_out11 # Salon Plafon - platform: gpio name: "hub2_in13" # Schody 2 pin: @@ -958,7 +1355,55 @@ binary_sensor: number: 13 mode: INPUT inverted: True + filters: + - delayed_on_off: 30ms id: hub2_in13 + on_multi_click: + - timing: + - ON for at most 350ms + - OFF for at least 350ms + then: + - homeassistant.service: + service: light.toggle + data: + entity_id: light.salon_kinkiet_1_led # Salon Kinkiet 1 + - homeassistant.service: + service: light.toggle + data: + entity_id: light.salon_kinkiet_2_led # Salon Kinkiet 2 + - homeassistant.service: + service: light.toggle + data: + entity_id: light.salon_kinkiet_3_led # Salon Kinkiet 3 + - timing: + - ON for at most 350ms + - OFF for at most 350ms + - ON for at most 350ms + - OFF for at least 350ms + then: + - homeassistant.service: + service: light.toggle + data: + entity_id: light.salon_kinkiety_led # Salon Kinkiety LED (grupa) + - homeassistant.service: + service: light.toggle + data: + entity_id: light.salon_kinkiet_1_led # Salon Kinkiet 1 + - homeassistant.service: + service: light.toggle + data: + entity_id: light.salon_kinkiet_2_led # Salon Kinkiet 2 + - homeassistant.service: + service: light.toggle + data: + entity_id: light.salon_kinkiet_3_led # Salon Kinkiet 3 + - timing: + - ON for at least 350ms + then: + - homeassistant.service: + service: light.toggle + data: + entity_id: light.komin_led # Komin LED - platform: gpio name: "hub2_in14" # (niepodpięte) pin: @@ -966,6 +1411,8 @@ binary_sensor: number: 14 mode: INPUT inverted: True + filters: + - delayed_on_off: 30ms id: hub2_in14 - platform: gpio name: "hub2_in15" # (niepodpięte) @@ -974,6 +1421,8 @@ binary_sensor: number: 15 mode: INPUT inverted: True + filters: + - delayed_on_off: 30ms id: hub2_in15 ################## #mcp23xxx_hub3_IN# @@ -985,7 +1434,15 @@ binary_sensor: number: 0 mode: INPUT inverted: True + filters: + - delayed_on_off: 30ms id: hub3_in0 + on_multi_click: + - timing: + - ON for at most 350ms + - OFF for at least 350ms + then: + - switch.toggle: hub1_out7 # Garderoba Duża - platform: gpio name: "hub3_in1" # Garderoba Duża Prawy pin: @@ -993,6 +1450,8 @@ binary_sensor: number: 1 mode: INPUT inverted: True + filters: + - delayed_on_off: 30ms id: hub3_in1 - platform: gpio name: "hub3_in2" # SPA Lewy @@ -1001,7 +1460,19 @@ binary_sensor: number: 2 mode: INPUT inverted: True + filters: + - delayed_on_off: 30ms id: hub3_in2 + on_multi_click: + - timing: + - ON for at most 350ms + - OFF for at least 350ms + then: + - switch.toggle: hub2_out13 # SPA Zwisy + - timing: + - ON for at least 350ms + then: + - switch.toggle: hub1_out4 # SPA Wentylator - platform: gpio name: "hub3_in3" # SPA Prawy pin: @@ -1009,7 +1480,20 @@ binary_sensor: number: 3 mode: INPUT inverted: True + filters: + - delayed_on_off: 30ms id: hub3_in3 + on_multi_click: + - timing: + - ON for at most 350ms + - OFF for at least 350ms + then: + - switch.toggle: hub1_out4 # SPA Wentylator + - switch.toggle: hub1_out10 # SPA Halogeny + - timing: + - ON for at least 350ms + then: + - light.toggle: SPA_Ledy # SPA Ledy - platform: gpio name: "hub3_in4" # Biała Łazienka Ściana pin: @@ -1017,7 +1501,26 @@ binary_sensor: number: 4 mode: INPUT inverted: True + filters: + - delayed_on_off: 30ms id: hub3_in4 + on_multi_click: + - timing: + - ON for at most 350ms + - OFF for at least 350ms + then: + - switch.toggle: hub2_out0 # Łazienka Sufit + - timing: + - ON for at most 350ms + - OFF for at most 350ms + - ON for at most 350ms + - OFF for at least 350ms + then: + - light.toggle: biala_lazienka_wanna_led # Biała Łazienka Wanna LED + - timing: + - ON for at least 350ms + then: + - switch.toggle: hub2_out8 # Łazienka Wentylator - platform: gpio name: "hub3_in5" # Małe WC Lustro Prawy pin: @@ -1025,7 +1528,20 @@ binary_sensor: number: 5 mode: INPUT inverted: True + filters: + - delayed_on_off: 30ms id: hub3_in5 + on_multi_click: + - timing: + - ON for at most 350ms + - OFF for at least 350ms + then: + - switch.toggle: hub2_out5 # WC Wentylator + - switch.toggle: hub2_out2 # WC Sufit + - homeassistant.service: + service: light.toggle + data: + entity_id: light.wc_led # WC LED - platform: gpio name: "hub3_in6" # Małe WC Lustro Lewy pin: @@ -1033,7 +1549,15 @@ binary_sensor: number: 6 mode: INPUT inverted: True + filters: + - delayed_on_off: 30ms id: hub3_in6 + on_multi_click: + - timing: + - ON for at most 350ms + - OFF for at least 350ms + then: + - switch.toggle: hub1_out9 # WC Lustro - platform: gpio name: "hub3_in7" # Biała Łazienka Skos pin: @@ -1041,7 +1565,15 @@ binary_sensor: number: 7 mode: INPUT inverted: True + filters: + - delayed_on_off: 30ms id: hub3_in7 + on_multi_click: + - timing: + - ON for at most 350ms + - OFF for at least 350ms + then: + - switch.toggle: hub2_out4 # Łazienka Skos - platform: gpio name: "hub3_in8" # SPA Lustro Lewy pin: @@ -1049,7 +1581,15 @@ binary_sensor: number: 8 mode: INPUT inverted: True + filters: + - delayed_on_off: 30ms id: hub3_in8 + on_multi_click: + - timing: + - ON for at most 350ms + - OFF for at least 350ms + then: + - switch.toggle: hub1_out5 # Kanciapa pod schodami - platform: gpio name: "hub3_in9" # SPA Lustro Prawy pin: @@ -1057,7 +1597,15 @@ binary_sensor: number: 9 mode: INPUT inverted: True + filters: + - delayed_on_off: 30ms id: hub3_in9 + on_multi_click: + - timing: + - ON for at most 350ms + - OFF for at least 350ms + then: + - switch.toggle: hub1_out1 # SPA Kinkiet Lustro - platform: gpio name: "hub3_in10" # Biuro Skos pin: @@ -1065,7 +1613,22 @@ binary_sensor: number: 10 mode: INPUT inverted: True + filters: + - delayed_on_off: 30ms id: hub3_in10 + on_multi_click: + - timing: + - ON for at most 350ms + - OFF for at least 350ms + then: + - switch.toggle: hub1_out2 # Biuro + - timing: + - ON for at most 350ms + - OFF for at most 350ms + - ON for at most 350ms + - OFF for at least 350ms + then: + - light.toggle: serwer_led # Serwer LED - platform: gpio name: "hub3_in11" # Serwer Prawy pin: @@ -1073,7 +1636,31 @@ binary_sensor: number: 11 mode: INPUT inverted: True + filters: + - delayed_on_off: 30ms id: hub3_in11 + on_multi_click: + - timing: + - ON for at most 350ms + - OFF for at least 350ms + then: + - light.toggle: serwer_led # Serwer LED + - timing: + - ON for at most 350ms + - OFF for at most 350ms + - ON for at most 350ms + - OFF for at least 350ms + then: + - light.toggle: test_led_2 # TEST LED 2 + - timing: + - ON for at most 350ms + - OFF for at most 350ms + - ON for at most 350ms + - OFF for at most 350ms + - ON for at most 350ms + - OFF for at least 350ms + then: + - switch.toggle: hub3_out2 # Wentylator Główny Obieg - platform: gpio name: "hub3_in12" # Serwer Lewy pin: @@ -1081,7 +1668,27 @@ binary_sensor: number: 12 mode: INPUT inverted: True + filters: + - delayed_on_off: 30ms id: hub3_in12 + on_multi_click: + - timing: + - ON for at most 350ms + - OFF for at least 350ms + then: + - switch.toggle: hub1_out14 # Korytarz Halogeny + - timing: + - ON for at most 350ms + - OFF for at most 350ms + - ON for at most 350ms + - OFF for at least 350ms + then: + - switch.toggle: hub1_out14 # Korytarz Halogeny + - switch.toggle: hub1_out2 # Biuro + - timing: + - ON for at least 350ms + then: + - script.execute: off_all - platform: gpio name: "hub3_in13" # (niepodpięte) pin: @@ -1089,6 +1696,8 @@ binary_sensor: number: 13 mode: INPUT inverted: True + filters: + - delayed_on_off: 30ms id: hub3_in13 - platform: gpio name: "hub3_in14" # (niepodpięte) @@ -1097,6 +1706,8 @@ binary_sensor: number: 14 mode: INPUT inverted: True + filters: + - delayed_on_off: 30ms id: hub3_in14 - platform: gpio name: "hub3_in15" # (niepodpięte) @@ -1105,6 +1716,8 @@ binary_sensor: number: 15 mode: INPUT inverted: True + filters: + - delayed_on_off: 30ms id: hub3_in15 sensor: