From ff79909bf1ce6da6d78866692e0f12eb0ab2cf92 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Koco=C5=84?= Date: Fri, 17 Apr 2026 23:03:24 +0200 Subject: [PATCH] auto-commit --- .claude/settings.local.json | 3 +- Kuba/main-hub_do zrobienia.yaml | 556 ++++++++++++++++++++++++++++---- 2 files changed, 497 insertions(+), 62 deletions(-) diff --git a/.claude/settings.local.json b/.claude/settings.local.json index cad342e..6c7f618 100644 --- a/.claude/settings.local.json +++ b/.claude/settings.local.json @@ -6,7 +6,8 @@ "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(node -e ':*)", - "Bash(python3 *)" + "Bash(python3 *)", + "WebFetch(domain:esphome.io)" ] } } diff --git a/Kuba/main-hub_do zrobienia.yaml b/Kuba/main-hub_do zrobienia.yaml index a4034bb..72232d5 100644 --- a/Kuba/main-hub_do zrobienia.yaml +++ b/Kuba/main-hub_do zrobienia.yaml @@ -1,24 +1,67 @@ +# ESPHome Firmware +# ESP32-PoE Main-Hub — Peak Control / Jan Kocoń +# Hardware: ESP32dev, Ethernet LAN8720, 2x PCA9685, 3x MCP23017 IN, 3x MCP23017 OUT +# Description: +# Centralny hub oświetlenia dla całego domu. Steruje lokalnie 26 wyjściami (przekaźniki/MCP) +# oraz 9 kanałami LED (PCA9685 cwww/rgbww/mono). 48 wejść fizycznych z logiką on_multi_click. +# Zewnętrzne encje (WLED, wentylatory) sterowane przez homeassistant.service. +# +# Wymagane wpisy w secrets.yaml: +# api_key: "<32-byte-base64>" +# ota_key: "" +# web_password: "" +# +# Adresy I2C: +# 0x20 mcp23xxx_hub1_IN | 0x21 mcp23xxx_hub1_OUT +# 0x22 mcp23xxx_hub2_IN | 0x23 mcp23xxx_hub2_OUT +# 0x24 mcp23xxx_hub3_IN | 0x25 mcp23xxx_hub3_OUT +# 0x40 pca9685_hub1 | 0x41 pca9685_hub2 +# +# Statyczne IP: 10.10.0.5 Gateway: 10.10.0.1 + substitutions: - name: main-hub - friendly_name: 'Main Hub' - project_version: '1.1' + device_name: "main-hub" + friendly_name: "Main Hub" + device_make: "Peak Control - Jan Kocoń" + device_model: "ESP32-PoE Main-Hub" + project_version: "1.1" + log_level: "WARN" + static_ip: "10.10.0.5" + gateway: "10.10.0.1" + subnet: "255.255.255.0" esphome: - name: '${name}' - friendly_name: '${friendly_name}' + name: "${device_name}" + friendly_name: "${friendly_name}" + comment: "${device_model} by ${device_make}" name_add_mac_suffix: false + min_version: "2024.6.0" project: - name: peakcontrol.main-hub - version: '${project_version}' + name: "${device_make}.${device_model}" + version: "${project_version}" + on_boot: + priority: -100 + then: + - light.turn_on: + id: status_led + red: 0% + green: 0% + blue: 100% + brightness: 100% + effect: "Slow Pulse" esp32: board: esp32dev + variant: esp32 framework: type: esp-idf + version: recommended + sdkconfig_options: + CONFIG_ESP32_REV_MIN_FULL: "300" # Enable logging logger: - level: WARN + level: "${log_level}" # Enable Home Assistant API api: @@ -67,13 +110,15 @@ ethernet: type: LAN8720 mdc_pin: GPIO23 mdio_pin: GPIO18 - clk_mode: GPIO17_OUT + clk: + mode: CLK_OUT + pin: 17 phy_addr: 0 power_pin: GPIO12 manual_ip: - static_ip: 10.10.0.5 - gateway: 10.10.0.1 - subnet: 255.255.255.0 + static_ip: "${static_ip}" + gateway: "${gateway}" + subnet: "${subnet}" button: - platform: restart @@ -753,6 +798,23 @@ switch: id: hub3_out15 restore_mode: ALWAYS_OFF +text_sensor: + - platform: ethernet_info + ip_address: + name: "IP Address" + icon: "mdi:wan" + entity_category: diagnostic + - platform: template + name: "Firmware Version" + icon: "mdi:tag" + entity_category: diagnostic + lambda: return {"${project_version}"}; + - platform: version + name: "ESPHome Version" + icon: "mdi:information-outline" + entity_category: diagnostic + hide_timestamp: true + script: - id: off_all then: @@ -791,6 +853,9 @@ script: - light.turn_off: sypialnia_led binary_sensor: + - platform: status + name: "Status" + entity_category: diagnostic #Mains detector #- platform: gpio # pin: @@ -808,7 +873,7 @@ binary_sensor: mode: INPUT inverted: True filters: - - delayed_on_off: 30ms + - delayed_on_off: 50ms id: hub1_in0 on_multi_click: - timing: @@ -816,10 +881,22 @@ binary_sensor: - OFF for at least 350ms then: - switch.toggle: hub1_out15 # Wejście Halogeny + - homeassistant.service: + service: logbook.log + data: + name: "Main Hub" + message: "Wejście 1 [1×]" + entity_id: "binary_sensor.hub1_in0" - timing: - ON for at least 350ms then: - script.execute: off_all + - homeassistant.service: + service: logbook.log + data: + name: "Main Hub" + message: "Wejście 1 [długi]" + entity_id: "binary_sensor.hub1_in0" - platform: gpio name: "hub1_in1" # Wejście 3 pin: @@ -828,7 +905,7 @@ binary_sensor: mode: INPUT inverted: True filters: - - delayed_on_off: 30ms + - delayed_on_off: 50ms id: hub1_in1 - platform: gpio name: "hub1_in2" # Wejście 2 @@ -838,7 +915,7 @@ binary_sensor: mode: INPUT inverted: True filters: - - delayed_on_off: 30ms + - delayed_on_off: 50ms id: hub1_in2 on_multi_click: - timing: @@ -849,10 +926,22 @@ binary_sensor: service: light.toggle data: entity_id: light.korytarz_kinkiety # Korytarz Kinkiety + - homeassistant.service: + service: logbook.log + data: + name: "Main Hub" + message: "Wejście 2 [1×]" + entity_id: "binary_sensor.hub1_in2" - timing: - ON for at least 350ms then: - script.execute: off_all + - homeassistant.service: + service: logbook.log + data: + name: "Main Hub" + message: "Wejście 2 [długi]" + entity_id: "binary_sensor.hub1_in2" - platform: gpio name: "hub1_in3" # Sypialnia 3 pin: @@ -861,7 +950,7 @@ binary_sensor: mode: INPUT inverted: True filters: - - delayed_on_off: 30ms + - delayed_on_off: 50ms id: hub1_in3 on_multi_click: - timing: @@ -870,6 +959,12 @@ binary_sensor: then: - switch.toggle: hub2_out12 # Sypialnia Łóżko Lewa strona - switch.toggle: hub2_out1 # Sypialnia Łóżko Prawa strona + - homeassistant.service: + service: logbook.log + data: + name: "Main Hub" + message: "Sypialnia 3 [1×]" + entity_id: "binary_sensor.hub1_in3" - timing: - ON for at most 350ms - OFF for at most 350ms @@ -878,6 +973,12 @@ binary_sensor: then: - switch.toggle: hub2_out12 # Sypialnia Łóżko Lewa strona - switch.toggle: hub2_out1 # Sypialnia Łóżko Prawa strona + - homeassistant.service: + service: logbook.log + data: + name: "Main Hub" + message: "Sypialnia 3 [2×]" + entity_id: "binary_sensor.hub1_in3" - platform: gpio name: "hub1_in4" # Sypialnia 1 pin: @@ -886,7 +987,7 @@ binary_sensor: mode: INPUT inverted: True filters: - - delayed_on_off: 30ms + - delayed_on_off: 50ms id: hub1_in4 on_multi_click: - timing: @@ -894,6 +995,12 @@ binary_sensor: - OFF for at least 350ms then: - light.toggle: sypialnia_led # Sypialnia LED + - homeassistant.service: + service: logbook.log + data: + name: "Main Hub" + message: "Sypialnia 1 [1×]" + entity_id: "binary_sensor.hub1_in4" - platform: gpio name: "hub1_in5" # Sypialnia 2 pin: @@ -902,7 +1009,7 @@ binary_sensor: mode: INPUT inverted: True filters: - - delayed_on_off: 30ms + - delayed_on_off: 50ms id: hub1_in5 on_multi_click: - timing: @@ -910,6 +1017,12 @@ binary_sensor: - OFF for at least 350ms then: - switch.toggle: hub2_out7 # Sypialnia Halogen + - homeassistant.service: + service: logbook.log + data: + name: "Main Hub" + message: "Sypialnia 2 [1×]" + entity_id: "binary_sensor.hub1_in5" - platform: gpio name: "hub1_in6" # Sypialnia Łóżko Prawa Strona pin: @@ -918,7 +1031,7 @@ binary_sensor: mode: INPUT inverted: True filters: - - delayed_on_off: 30ms + - delayed_on_off: 50ms id: hub1_in6 on_multi_click: - timing: @@ -926,6 +1039,12 @@ binary_sensor: - OFF for at least 350ms then: - switch.toggle: hub2_out1 # Sypialnia Łóżko Prawa strona + - homeassistant.service: + service: logbook.log + data: + name: "Main Hub" + message: "Sypialnia Łóżko Prawo [1×]" + entity_id: "binary_sensor.hub1_in6" - timing: - ON for at most 350ms - OFF for at most 350ms @@ -934,10 +1053,22 @@ binary_sensor: then: - switch.toggle: hub2_out12 # Sypialnia Łóżko Lewa strona - switch.toggle: hub2_out1 # Sypialnia Łóżko Prawa strona + - homeassistant.service: + service: logbook.log + data: + name: "Main Hub" + message: "Sypialnia Łóżko Prawo [2×]" + entity_id: "binary_sensor.hub1_in6" - timing: - ON for at least 350ms then: - script.execute: off_all + - homeassistant.service: + service: logbook.log + data: + name: "Main Hub" + message: "Sypialnia Łóżko Prawo [długi]" + entity_id: "binary_sensor.hub1_in6" - platform: gpio name: "hub1_in7" # Sypialnia Łóżko Lewa Strona pin: @@ -946,7 +1077,7 @@ binary_sensor: mode: INPUT inverted: True filters: - - delayed_on_off: 30ms + - delayed_on_off: 50ms id: hub1_in7 on_multi_click: - timing: @@ -954,6 +1085,12 @@ binary_sensor: - OFF for at least 350ms then: - switch.toggle: hub2_out12 # Sypialnia Łóżko Lewa strona + - homeassistant.service: + service: logbook.log + data: + name: "Main Hub" + message: "Sypialnia Łóżko Lewo [1×]" + entity_id: "binary_sensor.hub1_in7" - timing: - ON for at most 350ms - OFF for at most 350ms @@ -962,10 +1099,22 @@ binary_sensor: then: - switch.toggle: hub2_out12 # Sypialnia Łóżko Lewa strona - switch.toggle: hub2_out1 # Sypialnia Łóżko Prawa strona + - homeassistant.service: + service: logbook.log + data: + name: "Main Hub" + message: "Sypialnia Łóżko Lewo [2×]" + entity_id: "binary_sensor.hub1_in7" - timing: - ON for at least 350ms then: - script.execute: off_all + - homeassistant.service: + service: logbook.log + data: + name: "Main Hub" + message: "Sypialnia Łóżko Lewo [długi]" + entity_id: "binary_sensor.hub1_in7" - platform: gpio name: "hub1_in8" # Pokój dla Gości Lewy pin: @@ -974,7 +1123,7 @@ binary_sensor: mode: INPUT inverted: True filters: - - delayed_on_off: 30ms + - delayed_on_off: 50ms id: hub1_in8 on_multi_click: - timing: @@ -982,6 +1131,12 @@ binary_sensor: - OFF for at least 350ms then: - switch.toggle: hub2_out10 # Pokój Gościnny Sufit + - homeassistant.service: + service: logbook.log + data: + name: "Main Hub" + message: "Pokój Gości Lewy [1×]" + entity_id: "binary_sensor.hub1_in8" - timing: - ON for at most 350ms - OFF for at most 350ms @@ -989,6 +1144,12 @@ binary_sensor: - OFF for at least 350ms then: - switch.toggle: hub1_out7 # Garderoba Duża + - homeassistant.service: + service: logbook.log + data: + name: "Main Hub" + message: "Pokój Gości Lewy [2×]" + entity_id: "binary_sensor.hub1_in8" - platform: gpio name: "hub1_in9" # Pokój dla Gości Prawy pin: @@ -997,7 +1158,7 @@ binary_sensor: mode: INPUT inverted: True filters: - - delayed_on_off: 30ms + - delayed_on_off: 50ms id: hub1_in9 on_multi_click: - timing: @@ -1005,6 +1166,12 @@ binary_sensor: - OFF for at least 350ms then: - light.toggle: pokoj_dla_gosci_led # Pokój dla Gości LED + - homeassistant.service: + service: logbook.log + data: + name: "Main Hub" + message: "Pokój Gości Prawy [1×]" + entity_id: "binary_sensor.hub1_in9" - platform: gpio name: "hub1_in10" # (niepodpięte) pin: @@ -1013,7 +1180,7 @@ binary_sensor: mode: INPUT inverted: True filters: - - delayed_on_off: 30ms + - delayed_on_off: 50ms id: hub1_in10 - platform: gpio name: "hub1_in11" # (niepodpięte) @@ -1023,7 +1190,7 @@ binary_sensor: mode: INPUT inverted: True filters: - - delayed_on_off: 30ms + - delayed_on_off: 50ms id: hub1_in11 - platform: gpio name: "hub1_in12" # (niepodpięte) @@ -1033,7 +1200,7 @@ binary_sensor: mode: INPUT inverted: True filters: - - delayed_on_off: 30ms + - delayed_on_off: 50ms id: hub1_in12 - platform: gpio name: "hub1_in13" # (niepodpięte) @@ -1043,7 +1210,7 @@ binary_sensor: mode: INPUT inverted: True filters: - - delayed_on_off: 30ms + - delayed_on_off: 50ms id: hub1_in13 - platform: gpio name: "hub1_in14" # (niepodpięte) @@ -1053,7 +1220,7 @@ binary_sensor: mode: INPUT inverted: True filters: - - delayed_on_off: 30ms + - delayed_on_off: 50ms id: hub1_in14 - platform: gpio name: "hub1_in15" # (niepodpięte) @@ -1063,7 +1230,7 @@ binary_sensor: mode: INPUT inverted: True filters: - - delayed_on_off: 30ms + - delayed_on_off: 50ms id: hub1_in15 ################## #mcp23xxx_hub2_IN# @@ -1076,7 +1243,7 @@ binary_sensor: mode: INPUT inverted: True filters: - - delayed_on_off: 30ms + - delayed_on_off: 50ms id: hub2_in0 on_multi_click: - timing: @@ -1084,6 +1251,12 @@ binary_sensor: - OFF for at least 350ms then: - switch.toggle: hub1_out15 # Wejście Halogeny + - homeassistant.service: + service: logbook.log + data: + name: "Main Hub" + message: "Korytarz 2 [1×]" + entity_id: "binary_sensor.hub2_in0" - platform: gpio name: "hub2_in1" # Korytarz 3 pin: @@ -1092,7 +1265,7 @@ binary_sensor: mode: INPUT inverted: True filters: - - delayed_on_off: 30ms + - delayed_on_off: 50ms id: hub2_in1 on_multi_click: - timing: @@ -1103,10 +1276,22 @@ binary_sensor: service: light.toggle data: entity_id: light.korytarz_kinkiety # Korytarz Kinkiety + - homeassistant.service: + service: logbook.log + data: + name: "Main Hub" + message: "Korytarz 3 [1×]" + entity_id: "binary_sensor.hub2_in1" - timing: - ON for at least 350ms then: - script.execute: off_all + - homeassistant.service: + service: logbook.log + data: + name: "Main Hub" + message: "Korytarz 3 [długi]" + entity_id: "binary_sensor.hub2_in1" - platform: gpio name: "hub2_in2" # Korytarz 1 pin: @@ -1115,7 +1300,7 @@ binary_sensor: mode: INPUT inverted: True filters: - - delayed_on_off: 30ms + - delayed_on_off: 50ms id: hub2_in2 on_multi_click: - timing: @@ -1123,10 +1308,22 @@ binary_sensor: - OFF for at least 350ms then: - switch.toggle: hub1_out14 # Korytarz Halogeny + - homeassistant.service: + service: logbook.log + data: + name: "Main Hub" + message: "Korytarz 1 [1×]" + entity_id: "binary_sensor.hub2_in2" - timing: - ON for at least 350ms then: - script.execute: off_all + - homeassistant.service: + service: logbook.log + data: + name: "Main Hub" + message: "Korytarz 1 [długi]" + entity_id: "binary_sensor.hub2_in2" - platform: gpio name: "hub2_in3" # Mały Korytarz pin: @@ -1135,7 +1332,7 @@ binary_sensor: mode: INPUT inverted: True filters: - - delayed_on_off: 30ms + - delayed_on_off: 50ms id: hub2_in3 on_multi_click: - timing: @@ -1144,6 +1341,12 @@ binary_sensor: then: - switch.toggle: hub1_out13 # Mały Korytarz Kinkiet - switch.toggle: hub2_out3 # Mały Korytarz Sufit + - homeassistant.service: + service: logbook.log + data: + name: "Main Hub" + message: "Mały Korytarz [1×]" + entity_id: "binary_sensor.hub2_in3" - platform: gpio name: "hub2_in4" # Garderoba Mała pin: @@ -1152,7 +1355,7 @@ binary_sensor: mode: INPUT inverted: True filters: - - delayed_on_off: 30ms + - delayed_on_off: 50ms id: hub2_in4 on_multi_click: - timing: @@ -1160,6 +1363,12 @@ binary_sensor: - OFF for at least 350ms then: - switch.toggle: hub2_out14 # Mała Garderoba + - homeassistant.service: + service: logbook.log + data: + name: "Main Hub" + message: "Garderoba Mała [1×]" + entity_id: "binary_sensor.hub2_in4" - timing: - ON for at most 350ms - OFF for at most 350ms @@ -1167,6 +1376,12 @@ binary_sensor: - OFF for at least 350ms then: - switch.toggle: hub3_out2 # Wentylator Główny Obieg + - homeassistant.service: + service: logbook.log + data: + name: "Main Hub" + message: "Garderoba Mała [2×]" + entity_id: "binary_sensor.hub2_in4" - platform: gpio name: "hub2_in5" # Kuchnia 3_1 pin: @@ -1175,7 +1390,7 @@ binary_sensor: mode: INPUT inverted: True filters: - - delayed_on_off: 30ms + - delayed_on_off: 50ms id: hub2_in5 on_multi_click: - timing: @@ -1183,6 +1398,12 @@ binary_sensor: - OFF for at least 350ms then: - switch.toggle: hub1_out8 # Jadalnia + - homeassistant.service: + service: logbook.log + data: + name: "Main Hub" + message: "Kuchnia Filar 3_1 [1×]" + entity_id: "binary_sensor.hub2_in5" - platform: gpio name: "hub2_in6" # Kuchnia 3_2 pin: @@ -1191,7 +1412,7 @@ binary_sensor: mode: INPUT inverted: True filters: - - delayed_on_off: 30ms + - delayed_on_off: 50ms id: hub2_in6 on_multi_click: - timing: @@ -1199,6 +1420,12 @@ binary_sensor: - OFF for at least 350ms then: - light.toggle: jadalnia_led # Jadalnia LED + - homeassistant.service: + service: logbook.log + data: + name: "Main Hub" + message: "Kuchnia Filar 3_2 [1×]" + entity_id: "binary_sensor.hub2_in6" - platform: gpio name: "hub2_in7" # Kuchnia 2_1 pin: @@ -1207,7 +1434,7 @@ binary_sensor: mode: INPUT inverted: True filters: - - delayed_on_off: 30ms + - delayed_on_off: 50ms id: hub2_in7 on_multi_click: - timing: @@ -1215,10 +1442,22 @@ binary_sensor: - OFF for at least 350ms then: - switch.toggle: hub1_out3 # Kuchnia Halogen + - homeassistant.service: + service: logbook.log + data: + name: "Main Hub" + message: "Kuchnia Filar 2_1 [1×]" + entity_id: "binary_sensor.hub2_in7" - timing: - ON for at least 350ms then: - script.execute: off_all + - homeassistant.service: + service: logbook.log + data: + name: "Main Hub" + message: "Kuchnia Filar 2_1 [długi]" + entity_id: "binary_sensor.hub2_in7" - platform: gpio name: "hub2_in8" # Kuchnia 2_2 pin: @@ -1227,7 +1466,7 @@ binary_sensor: mode: INPUT inverted: True filters: - - delayed_on_off: 30ms + - delayed_on_off: 50ms id: hub2_in8 on_multi_click: - timing: @@ -1235,6 +1474,12 @@ binary_sensor: - OFF for at least 350ms then: - light.toggle: kuchnia_lezka_led # Kuchnia Łezka LED + - homeassistant.service: + service: logbook.log + data: + name: "Main Hub" + message: "Kuchnia Filar 2_2 [1×]" + entity_id: "binary_sensor.hub2_in8" - platform: gpio name: "hub2_in9" # Kuchnia 1_1 pin: @@ -1243,7 +1488,7 @@ binary_sensor: mode: INPUT inverted: True filters: - - delayed_on_off: 30ms + - delayed_on_off: 50ms id: hub2_in9 on_multi_click: - timing: @@ -1251,6 +1496,12 @@ binary_sensor: - OFF for at least 350ms then: - switch.toggle: hub2_out11 # Salon Plafon + - homeassistant.service: + service: logbook.log + data: + name: "Main Hub" + message: "Kuchnia Filar 1_1 [1×]" + entity_id: "binary_sensor.hub2_in9" - timing: - ON for at most 350ms - OFF for at most 350ms @@ -1261,6 +1512,12 @@ binary_sensor: service: switch.toggle data: entity_id: switch.salon_wentylator # Salon Wentylator + - homeassistant.service: + service: logbook.log + data: + name: "Main Hub" + message: "Kuchnia Filar 1_1 [2×]" + entity_id: "binary_sensor.hub2_in9" - platform: gpio name: "hub2_in10" # Kuchnia 1_2 pin: @@ -1269,7 +1526,7 @@ binary_sensor: mode: INPUT inverted: True filters: - - delayed_on_off: 30ms + - delayed_on_off: 50ms id: hub2_in10 on_multi_click: - timing: @@ -1284,6 +1541,12 @@ binary_sensor: service: light.toggle data: entity_id: light.salon_kinkiety_led # Salon Kinkiety LED + - homeassistant.service: + service: logbook.log + data: + name: "Main Hub" + message: "Kuchnia Filar 1_2 [1×]" + entity_id: "binary_sensor.hub2_in10" - timing: - ON for at most 350ms - OFF for at most 350ms @@ -1294,6 +1557,12 @@ binary_sensor: service: light.toggle data: entity_id: light.komin_led # Komin LED + - homeassistant.service: + service: logbook.log + data: + name: "Main Hub" + message: "Kuchnia Filar 1_2 [2×]" + entity_id: "binary_sensor.hub2_in10" - timing: - ON for at least 350ms then: @@ -1301,6 +1570,12 @@ binary_sensor: service: light.toggle data: entity_id: light.komin_led # Komin LED + - homeassistant.service: + service: logbook.log + data: + name: "Main Hub" + message: "Kuchnia Filar 1_2 [długi]" + entity_id: "binary_sensor.hub2_in10" - platform: gpio name: "hub2_in11" # Schody 3 pin: @@ -1309,7 +1584,7 @@ binary_sensor: mode: INPUT inverted: True filters: - - delayed_on_off: 30ms + - delayed_on_off: 50ms id: hub2_in11 on_multi_click: - timing: @@ -1332,6 +1607,12 @@ binary_sensor: service: light.toggle data: entity_id: light.zwis_schody_2 # Zwis Schody + - homeassistant.service: + service: logbook.log + data: + name: "Main Hub" + message: "Schody 3 [1×]" + entity_id: "binary_sensor.hub2_in11" - platform: gpio name: "hub2_in12" # Schody 1 pin: @@ -1340,7 +1621,7 @@ binary_sensor: mode: INPUT inverted: True filters: - - delayed_on_off: 30ms + - delayed_on_off: 50ms id: hub2_in12 on_multi_click: - timing: @@ -1348,6 +1629,12 @@ binary_sensor: - OFF for at least 350ms then: - switch.toggle: hub2_out11 # Salon Plafon + - homeassistant.service: + service: logbook.log + data: + name: "Main Hub" + message: "Schody 1 [1×]" + entity_id: "binary_sensor.hub2_in12" - platform: gpio name: "hub2_in13" # Schody 2 pin: @@ -1356,7 +1643,7 @@ binary_sensor: mode: INPUT inverted: True filters: - - delayed_on_off: 30ms + - delayed_on_off: 50ms id: hub2_in13 on_multi_click: - timing: @@ -1375,6 +1662,12 @@ binary_sensor: service: light.toggle data: entity_id: light.salon_kinkiet_3_led # Salon Kinkiet 3 + - homeassistant.service: + service: logbook.log + data: + name: "Main Hub" + message: "Schody 2 [1×]" + entity_id: "binary_sensor.hub2_in13" - timing: - ON for at most 350ms - OFF for at most 350ms @@ -1397,6 +1690,12 @@ binary_sensor: service: light.toggle data: entity_id: light.salon_kinkiet_3_led # Salon Kinkiet 3 + - homeassistant.service: + service: logbook.log + data: + name: "Main Hub" + message: "Schody 2 [2×]" + entity_id: "binary_sensor.hub2_in13" - timing: - ON for at least 350ms then: @@ -1404,6 +1703,12 @@ binary_sensor: service: light.toggle data: entity_id: light.komin_led # Komin LED + - homeassistant.service: + service: logbook.log + data: + name: "Main Hub" + message: "Schody 2 [długi]" + entity_id: "binary_sensor.hub2_in13" - platform: gpio name: "hub2_in14" # (niepodpięte) pin: @@ -1412,7 +1717,7 @@ binary_sensor: mode: INPUT inverted: True filters: - - delayed_on_off: 30ms + - delayed_on_off: 50ms id: hub2_in14 - platform: gpio name: "hub2_in15" # (niepodpięte) @@ -1422,7 +1727,7 @@ binary_sensor: mode: INPUT inverted: True filters: - - delayed_on_off: 30ms + - delayed_on_off: 50ms id: hub2_in15 ################## #mcp23xxx_hub3_IN# @@ -1435,7 +1740,7 @@ binary_sensor: mode: INPUT inverted: True filters: - - delayed_on_off: 30ms + - delayed_on_off: 50ms id: hub3_in0 on_multi_click: - timing: @@ -1443,6 +1748,12 @@ binary_sensor: - OFF for at least 350ms then: - switch.toggle: hub1_out7 # Garderoba Duża + - homeassistant.service: + service: logbook.log + data: + name: "Main Hub" + message: "Garderoba Duża Lewy [1×]" + entity_id: "binary_sensor.hub3_in0" - platform: gpio name: "hub3_in1" # Garderoba Duża Prawy pin: @@ -1451,7 +1762,7 @@ binary_sensor: mode: INPUT inverted: True filters: - - delayed_on_off: 30ms + - delayed_on_off: 50ms id: hub3_in1 - platform: gpio name: "hub3_in2" # SPA Lewy @@ -1461,7 +1772,7 @@ binary_sensor: mode: INPUT inverted: True filters: - - delayed_on_off: 30ms + - delayed_on_off: 50ms id: hub3_in2 on_multi_click: - timing: @@ -1469,10 +1780,22 @@ binary_sensor: - OFF for at least 350ms then: - switch.toggle: hub2_out13 # SPA Zwisy + - homeassistant.service: + service: logbook.log + data: + name: "Main Hub" + message: "SPA Lewy [1×]" + entity_id: "binary_sensor.hub3_in2" - timing: - ON for at least 350ms then: - switch.toggle: hub1_out4 # SPA Wentylator + - homeassistant.service: + service: logbook.log + data: + name: "Main Hub" + message: "SPA Lewy [długi]" + entity_id: "binary_sensor.hub3_in2" - platform: gpio name: "hub3_in3" # SPA Prawy pin: @@ -1481,7 +1804,7 @@ binary_sensor: mode: INPUT inverted: True filters: - - delayed_on_off: 30ms + - delayed_on_off: 50ms id: hub3_in3 on_multi_click: - timing: @@ -1490,10 +1813,22 @@ binary_sensor: then: - switch.toggle: hub1_out4 # SPA Wentylator - switch.toggle: hub1_out10 # SPA Halogeny + - homeassistant.service: + service: logbook.log + data: + name: "Main Hub" + message: "SPA Prawy [1×]" + entity_id: "binary_sensor.hub3_in3" - timing: - ON for at least 350ms then: - light.toggle: SPA_Ledy # SPA Ledy + - homeassistant.service: + service: logbook.log + data: + name: "Main Hub" + message: "SPA Prawy [długi]" + entity_id: "binary_sensor.hub3_in3" - platform: gpio name: "hub3_in4" # Biała Łazienka Ściana pin: @@ -1502,7 +1837,7 @@ binary_sensor: mode: INPUT inverted: True filters: - - delayed_on_off: 30ms + - delayed_on_off: 50ms id: hub3_in4 on_multi_click: - timing: @@ -1510,6 +1845,12 @@ binary_sensor: - OFF for at least 350ms then: - switch.toggle: hub2_out0 # Łazienka Sufit + - homeassistant.service: + service: logbook.log + data: + name: "Main Hub" + message: "Biała Łazienka [1×]" + entity_id: "binary_sensor.hub3_in4" - timing: - ON for at most 350ms - OFF for at most 350ms @@ -1517,10 +1858,22 @@ binary_sensor: - OFF for at least 350ms then: - light.toggle: biala_lazienka_wanna_led # Biała Łazienka Wanna LED + - homeassistant.service: + service: logbook.log + data: + name: "Main Hub" + message: "Biała Łazienka [2×]" + entity_id: "binary_sensor.hub3_in4" - timing: - ON for at least 350ms then: - switch.toggle: hub2_out8 # Łazienka Wentylator + - homeassistant.service: + service: logbook.log + data: + name: "Main Hub" + message: "Biała Łazienka [długi]" + entity_id: "binary_sensor.hub3_in4" - platform: gpio name: "hub3_in5" # Małe WC Lustro Prawy pin: @@ -1529,7 +1882,7 @@ binary_sensor: mode: INPUT inverted: True filters: - - delayed_on_off: 30ms + - delayed_on_off: 50ms id: hub3_in5 on_multi_click: - timing: @@ -1542,6 +1895,12 @@ binary_sensor: service: light.toggle data: entity_id: light.wc_led # WC LED + - homeassistant.service: + service: logbook.log + data: + name: "Main Hub" + message: "WC Prawy [1×]" + entity_id: "binary_sensor.hub3_in5" - platform: gpio name: "hub3_in6" # Małe WC Lustro Lewy pin: @@ -1550,7 +1909,7 @@ binary_sensor: mode: INPUT inverted: True filters: - - delayed_on_off: 30ms + - delayed_on_off: 50ms id: hub3_in6 on_multi_click: - timing: @@ -1558,6 +1917,12 @@ binary_sensor: - OFF for at least 350ms then: - switch.toggle: hub1_out9 # WC Lustro + - homeassistant.service: + service: logbook.log + data: + name: "Main Hub" + message: "WC Lewy [1×]" + entity_id: "binary_sensor.hub3_in6" - platform: gpio name: "hub3_in7" # Biała Łazienka Skos pin: @@ -1566,7 +1931,7 @@ binary_sensor: mode: INPUT inverted: True filters: - - delayed_on_off: 30ms + - delayed_on_off: 50ms id: hub3_in7 on_multi_click: - timing: @@ -1574,6 +1939,12 @@ binary_sensor: - OFF for at least 350ms then: - switch.toggle: hub2_out4 # Łazienka Skos + - homeassistant.service: + service: logbook.log + data: + name: "Main Hub" + message: "Biała Łazienka Skos [1×]" + entity_id: "binary_sensor.hub3_in7" - platform: gpio name: "hub3_in8" # SPA Lustro Lewy pin: @@ -1582,7 +1953,7 @@ binary_sensor: mode: INPUT inverted: True filters: - - delayed_on_off: 30ms + - delayed_on_off: 50ms id: hub3_in8 on_multi_click: - timing: @@ -1590,6 +1961,12 @@ binary_sensor: - OFF for at least 350ms then: - switch.toggle: hub1_out5 # Kanciapa pod schodami + - homeassistant.service: + service: logbook.log + data: + name: "Main Hub" + message: "SPA Lustro Lewy [1×]" + entity_id: "binary_sensor.hub3_in8" - platform: gpio name: "hub3_in9" # SPA Lustro Prawy pin: @@ -1598,7 +1975,7 @@ binary_sensor: mode: INPUT inverted: True filters: - - delayed_on_off: 30ms + - delayed_on_off: 50ms id: hub3_in9 on_multi_click: - timing: @@ -1606,6 +1983,12 @@ binary_sensor: - OFF for at least 350ms then: - switch.toggle: hub1_out1 # SPA Kinkiet Lustro + - homeassistant.service: + service: logbook.log + data: + name: "Main Hub" + message: "SPA Lustro Prawy [1×]" + entity_id: "binary_sensor.hub3_in9" - platform: gpio name: "hub3_in10" # Biuro Skos pin: @@ -1614,7 +1997,7 @@ binary_sensor: mode: INPUT inverted: True filters: - - delayed_on_off: 30ms + - delayed_on_off: 50ms id: hub3_in10 on_multi_click: - timing: @@ -1622,6 +2005,12 @@ binary_sensor: - OFF for at least 350ms then: - switch.toggle: hub1_out2 # Biuro + - homeassistant.service: + service: logbook.log + data: + name: "Main Hub" + message: "Biuro Skos [1×]" + entity_id: "binary_sensor.hub3_in10" - timing: - ON for at most 350ms - OFF for at most 350ms @@ -1629,6 +2018,12 @@ binary_sensor: - OFF for at least 350ms then: - light.toggle: serwer_led # Serwer LED + - homeassistant.service: + service: logbook.log + data: + name: "Main Hub" + message: "Biuro Skos [2×]" + entity_id: "binary_sensor.hub3_in10" - platform: gpio name: "hub3_in11" # Serwer Prawy pin: @@ -1637,7 +2032,7 @@ binary_sensor: mode: INPUT inverted: True filters: - - delayed_on_off: 30ms + - delayed_on_off: 50ms id: hub3_in11 on_multi_click: - timing: @@ -1645,6 +2040,12 @@ binary_sensor: - OFF for at least 350ms then: - light.toggle: serwer_led # Serwer LED + - homeassistant.service: + service: logbook.log + data: + name: "Main Hub" + message: "Serwer Prawy [1×]" + entity_id: "binary_sensor.hub3_in11" - timing: - ON for at most 350ms - OFF for at most 350ms @@ -1652,6 +2053,12 @@ binary_sensor: - OFF for at least 350ms then: - light.toggle: test_led_2 # TEST LED 2 + - homeassistant.service: + service: logbook.log + data: + name: "Main Hub" + message: "Serwer Prawy [2×]" + entity_id: "binary_sensor.hub3_in11" - timing: - ON for at most 350ms - OFF for at most 350ms @@ -1661,6 +2068,12 @@ binary_sensor: - OFF for at least 350ms then: - switch.toggle: hub3_out2 # Wentylator Główny Obieg + - homeassistant.service: + service: logbook.log + data: + name: "Main Hub" + message: "Serwer Prawy [3×]" + entity_id: "binary_sensor.hub3_in11" - platform: gpio name: "hub3_in12" # Serwer Lewy pin: @@ -1669,7 +2082,7 @@ binary_sensor: mode: INPUT inverted: True filters: - - delayed_on_off: 30ms + - delayed_on_off: 50ms id: hub3_in12 on_multi_click: - timing: @@ -1677,6 +2090,12 @@ binary_sensor: - OFF for at least 350ms then: - switch.toggle: hub1_out14 # Korytarz Halogeny + - homeassistant.service: + service: logbook.log + data: + name: "Main Hub" + message: "Serwer Lewy [1×]" + entity_id: "binary_sensor.hub3_in12" - timing: - ON for at most 350ms - OFF for at most 350ms @@ -1685,10 +2104,22 @@ binary_sensor: then: - switch.toggle: hub1_out14 # Korytarz Halogeny - switch.toggle: hub1_out2 # Biuro + - homeassistant.service: + service: logbook.log + data: + name: "Main Hub" + message: "Serwer Lewy [2×]" + entity_id: "binary_sensor.hub3_in12" - timing: - ON for at least 350ms then: - script.execute: off_all + - homeassistant.service: + service: logbook.log + data: + name: "Main Hub" + message: "Serwer Lewy [długi]" + entity_id: "binary_sensor.hub3_in12" - platform: gpio name: "hub3_in13" # (niepodpięte) pin: @@ -1697,7 +2128,7 @@ binary_sensor: mode: INPUT inverted: True filters: - - delayed_on_off: 30ms + - delayed_on_off: 50ms id: hub3_in13 - platform: gpio name: "hub3_in14" # (niepodpięte) @@ -1707,7 +2138,7 @@ binary_sensor: mode: INPUT inverted: True filters: - - delayed_on_off: 30ms + - delayed_on_off: 50ms id: hub3_in14 - platform: gpio name: "hub3_in15" # (niepodpięte) @@ -1717,13 +2148,16 @@ binary_sensor: mode: INPUT inverted: True filters: - - delayed_on_off: 30ms + - delayed_on_off: 50ms id: hub3_in15 sensor: - platform: uptime type: seconds - name: Uptime Sensor + name: "Uptime" + icon: "mdi:clock-outline" + entity_category: diagnostic + update_interval: 300s - platform: atc_mithermometer mac_address: "A4:C1:38:C5:11:58" temperature: