substitutions: 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 framework: type: esp-idf # Enable logging logger: level: WARN # Enable Home Assistant API api: encryption: 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: !secret ota_key - platform: web_server #wifi: # ssid: !secret wifi_ssid # password: !secret wifi_password # # # Enable fallback hotspot (captive portal) in case wifi connection fails # ap: # ssid: "Main-Hub Fallback Hotspot" # password: "y0LGSOyT5tjJ" #captive_portal: web_server: port: 80 auth: username: admin password: !secret web_password ethernet: type: LAN8720 mdc_pin: GPIO23 mdio_pin: GPIO18 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: '${friendly_name} Restart' i2c: sda: 13 scl: 16 scan: True frequency: 200kHz pca9685: - frequency: 1500 address: 0x40 id: "pca9685_hub1" - frequency: 1500 address: 0x41 id: "pca9685_hub2" mcp23017: - id: "mcp23xxx_hub1_IN" address: 0x20 - id: "mcp23xxx_hub1_OUT" address: 0x21 - id: "mcp23xxx_hub2_IN" address: 0x22 - id: "mcp23xxx_hub2_OUT" address: 0x23 - id: "mcp23xxx_hub3_IN" address: 0x24 - id: "mcp23xxx_hub3_OUT" address: 0x25 output: - platform: ledc id: output_blue pin: 5 - platform: ledc id: output_green pin: 14 - platform: ledc id: output_red pin: 15 #deklaracja LED - platform: pca9685 id: 'PWM1_1_Hub1' pca9685_id: 'pca9685_hub1' channel: 0 max_power: 100% - platform: pca9685 id: 'PWM1_2_Hub1' pca9685_id: 'pca9685_hub1' channel: 1 max_power: 100% - platform: pca9685 id: 'PWM2_1_Hub1' pca9685_id: 'pca9685_hub1' channel: 2 max_power: 100% - platform: pca9685 id: 'PWM2_2_Hub1' pca9685_id: 'pca9685_hub1' channel: 3 max_power: 100% - platform: pca9685 id: 'PWM3_1_Hub1' pca9685_id: 'pca9685_hub1' channel: 4 max_power: 100% - platform: pca9685 id: 'PWM3_2_Hub1' pca9685_id: 'pca9685_hub1' channel: 8 max_power: 100% - platform: pca9685 id: 'PWM4_1_Hub1' pca9685_id: 'pca9685_hub1' channel: 6 min_power: 0% max_power: 100% - platform: pca9685 id: 'PWM4_2_Hub1' pca9685_id: 'pca9685_hub1' channel: 7 min_power: 0% max_power: 100% - platform: pca9685 id: 'PWM5_1_Hub1' pca9685_id: 'pca9685_hub1' channel: 12 max_power: 100% - platform: pca9685 id: 'PWM5_2_Hub1' pca9685_id: 'pca9685_hub1' channel: 13 max_power: 100% - platform: pca9685 id: 'PWM1_1_Hub2' pca9685_id: 'pca9685_hub2' channel: 0 max_power: 100% - platform: pca9685 id: 'PWM1_2_Hub2' pca9685_id: 'pca9685_hub2' channel: 1 max_power: 100% - platform: pca9685 id: 'PWM2_1_Hub2' pca9685_id: 'pca9685_hub2' channel: 2 max_power: 100% - platform: pca9685 id: 'PWM2_2_Hub2' pca9685_id: 'pca9685_hub2' channel: 3 max_power: 100% - platform: pca9685 id: 'PWM3_1_Hub2' pca9685_id: 'pca9685_hub2' channel: 4 max_power: 100% - platform: pca9685 id: 'PWM3_2_Hub2' pca9685_id: 'pca9685_hub2' channel: 5 max_power: 95% - platform: pca9685 id: 'PWM4_1_Hub2' pca9685_id: 'pca9685_hub2' channel: 10 max_power: 100% - platform: pca9685 id: 'PWM4_2_Hub2' pca9685_id: 'pca9685_hub2' channel: 13 max_power: 100% - platform: pca9685 id: 'PWM5_1_Hub2' pca9685_id: 'pca9685_hub2' channel: 11 max_power: 100% - platform: pca9685 id: 'PWM5_2_Hub2' pca9685_id: 'pca9685_hub2' channel: 15 max_power: 100% light: - platform: rgb name: "Status LED" id: status_led red: output_red green: output_green blue: output_blue effects: - pulse: name: "Fast Pulse" transition_length: 0.5s update_interval: 0.5s - pulse: name: "Slow Pulse" transition_length: 1s update_interval: 1s - random: name: "Random Effect" transition_length: 1s update_interval: 2s #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 warm_white_color_temperature: 2000 K 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 warm_white_color_temperature: 2000 K 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 warm_white_color_temperature: 2000 K 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 name: "SPA Ledy" id: "SPA_Ledy" cold_white: PWM5_2_Hub2 warm_white: PWM5_1_Hub2 cold_white_color_temperature: 6536 K warm_white_color_temperature: 2000 K 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 warm_white_color_temperature: 2000 K default_transition_length: 2.0s - platform: monochromatic name: "TEST LED 1" 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 cold_white: PWM3_2_Hub1 warm_white: PWM1_1_Hub2 cold_white_color_temperature: 6536 K warm_white_color_temperature: 2000 K color_interlock: false default_transition_length: 2.0s time: - platform: homeassistant timezone: Europe/Warsaw id: ha_time esp32_ble_tracker: switch: #mcp23xxx_hub1_OUT - platform: gpio name: "hub1_out0" # (wolne) pin: mcp23xxx: mcp23xxx_hub1_OUT number: 0 mode: OUTPUT inverted: False id: hub1_out0 restore_mode: ALWAYS_OFF - platform: gpio name: "hub1_out1" # SPA Kinkiet Lustro pin: mcp23xxx: mcp23xxx_hub1_OUT number: 1 mode: OUTPUT inverted: False id: hub1_out1 restore_mode: ALWAYS_OFF - platform: gpio name: "hub1_out2" # Biuro pin: mcp23xxx: mcp23xxx_hub1_OUT number: 2 mode: OUTPUT inverted: False id: hub1_out2 restore_mode: ALWAYS_OFF - platform: gpio name: "hub1_out3" # Kuchnia Halogen pin: mcp23xxx: mcp23xxx_hub1_OUT number: 3 mode: OUTPUT inverted: False id: hub1_out3 restore_mode: ALWAYS_OFF - platform: gpio name: "hub1_out4" # SPA Wentylator [FAN] pin: mcp23xxx: mcp23xxx_hub1_OUT number: 4 mode: OUTPUT inverted: False id: hub1_out4 restore_mode: ALWAYS_OFF - platform: gpio name: "hub1_out5" # Kanciapa pod schodami pin: mcp23xxx: mcp23xxx_hub1_OUT number: 5 mode: OUTPUT inverted: False id: hub1_out5 restore_mode: ALWAYS_OFF - platform: gpio name: "hub1_out6" # (wolne) pin: mcp23xxx: mcp23xxx_hub1_OUT number: 6 mode: OUTPUT inverted: False id: hub1_out6 restore_mode: ALWAYS_OFF - platform: gpio name: "hub1_out7" # Garderoba Duża pin: mcp23xxx: mcp23xxx_hub1_OUT number: 7 mode: OUTPUT inverted: False id: hub1_out7 restore_mode: ALWAYS_OFF - platform: gpio name: "hub1_out8" # Jadalnia pin: mcp23xxx: mcp23xxx_hub1_OUT number: 8 mode: OUTPUT inverted: False id: hub1_out8 restore_mode: ALWAYS_OFF - platform: gpio name: "hub1_out9" # WC Lustro pin: mcp23xxx: mcp23xxx_hub1_OUT number: 9 mode: OUTPUT inverted: False id: hub1_out9 restore_mode: ALWAYS_OFF - platform: gpio name: "hub1_out10" # SPA Halogeny pin: mcp23xxx: mcp23xxx_hub1_OUT number: 10 mode: OUTPUT inverted: False id: hub1_out10 restore_mode: ALWAYS_OFF - platform: gpio name: "hub1_out11" # (wolne) pin: mcp23xxx: mcp23xxx_hub1_OUT number: 11 mode: OUTPUT inverted: False id: hub1_out11 restore_mode: ALWAYS_OFF - platform: gpio name: "hub1_out12" # (wolne) pin: mcp23xxx: mcp23xxx_hub1_OUT number: 12 mode: OUTPUT inverted: False id: hub1_out12 restore_mode: ALWAYS_OFF - platform: gpio name: "hub1_out13" # Mały Korytarz Kinkiet pin: mcp23xxx: mcp23xxx_hub1_OUT number: 13 mode: OUTPUT inverted: False id: hub1_out13 restore_mode: ALWAYS_OFF - platform: gpio name: "hub1_out14" # Korytarz Halogeny pin: mcp23xxx: mcp23xxx_hub1_OUT number: 14 mode: OUTPUT inverted: False id: hub1_out14 restore_mode: ALWAYS_OFF - platform: gpio name: "hub1_out15" # Wejście Halogeny pin: mcp23xxx: mcp23xxx_hub1_OUT number: 15 mode: OUTPUT inverted: False id: hub1_out15 restore_mode: ALWAYS_OFF #mcp23xxx_hub2_OUT - platform: gpio name: "hub2_out0" # Łazienka Sufit pin: mcp23xxx: mcp23xxx_hub2_OUT number: 0 mode: OUTPUT inverted: False id: hub2_out0 restore_mode: ALWAYS_OFF - platform: gpio name: "hub2_out1" # Sypialnia Łóżko Prawa strona pin: mcp23xxx: mcp23xxx_hub2_OUT number: 1 mode: OUTPUT inverted: False id: hub2_out1 restore_mode: ALWAYS_OFF - platform: gpio name: "hub2_out2" # WC Sufit pin: mcp23xxx: mcp23xxx_hub2_OUT number: 2 mode: OUTPUT inverted: False id: hub2_out2 restore_mode: ALWAYS_OFF - platform: gpio name: "hub2_out3" # Mały Korytarz Sufit pin: mcp23xxx: mcp23xxx_hub2_OUT number: 3 mode: OUTPUT inverted: False id: hub2_out3 restore_mode: ALWAYS_OFF - platform: gpio name: "hub2_out4" # Łazienka Skos pin: mcp23xxx: mcp23xxx_hub2_OUT number: 4 mode: OUTPUT inverted: False id: hub2_out4 restore_mode: ALWAYS_OFF - platform: gpio name: "hub2_out5" # WC Wentylator [FAN] pin: mcp23xxx: mcp23xxx_hub2_OUT number: 5 mode: OUTPUT inverted: False id: hub2_out5 restore_mode: ALWAYS_OFF - platform: gpio name: "hub2_out6" # (wolne) pin: mcp23xxx: mcp23xxx_hub2_OUT number: 6 mode: OUTPUT inverted: False id: hub2_out6 restore_mode: ALWAYS_OFF - platform: gpio name: "hub2_out7" # Sypialnia Halogen pin: mcp23xxx: mcp23xxx_hub2_OUT number: 7 mode: OUTPUT inverted: False id: hub2_out7 restore_mode: ALWAYS_OFF - platform: gpio name: "hub2_out8" # Łazienka Sufit (Biała Łazienka Wentylator) [FAN] pin: mcp23xxx: mcp23xxx_hub2_OUT number: 8 mode: OUTPUT inverted: False id: hub2_out8 restore_mode: ALWAYS_OFF - platform: gpio name: "hub2_out9" # (wolne) pin: mcp23xxx: mcp23xxx_hub2_OUT number: 9 mode: OUTPUT inverted: False id: hub2_out9 restore_mode: ALWAYS_OFF - platform: gpio name: "hub2_out10" # Pokój Gościnny Sufit pin: mcp23xxx: mcp23xxx_hub2_OUT number: 10 mode: OUTPUT inverted: False id: hub2_out10 restore_mode: ALWAYS_OFF - platform: gpio name: "hub2_out11" # Salon Plafon pin: mcp23xxx: mcp23xxx_hub2_OUT number: 11 mode: OUTPUT inverted: False id: hub2_out11 restore_mode: ALWAYS_OFF - platform: gpio name: "hub2_out12" # Sypialnia Łóżko Lewa strona pin: mcp23xxx: mcp23xxx_hub2_OUT number: 12 mode: OUTPUT inverted: False id: hub2_out12 restore_mode: ALWAYS_OFF - platform: gpio name: "hub2_out13" # SPA Zwisy pin: mcp23xxx: mcp23xxx_hub2_OUT number: 13 mode: OUTPUT inverted: False id: hub2_out13 restore_mode: ALWAYS_OFF - platform: gpio name: "hub2_out14" # Mała Garderoba pin: mcp23xxx: mcp23xxx_hub2_OUT number: 14 mode: OUTPUT inverted: False id: hub2_out14 restore_mode: ALWAYS_OFF - platform: gpio name: "hub2_out15" # (wolne) pin: mcp23xxx: mcp23xxx_hub2_OUT number: 15 mode: OUTPUT inverted: False id: hub2_out15 restore_mode: ALWAYS_OFF #mcp23xxx_hub3_OUT - platform: gpio name: "hub3_out0" # (wolne) pin: mcp23xxx: mcp23xxx_hub3_OUT number: 0 mode: OUTPUT inverted: False id: hub3_out0 restore_mode: ALWAYS_OFF - platform: gpio name: "hub3_out1" # (wolne) pin: mcp23xxx: mcp23xxx_hub3_OUT number: 1 mode: OUTPUT inverted: False id: hub3_out1 restore_mode: ALWAYS_OFF - platform: gpio name: "hub3_out2" # Wentylator Główny Obieg [FAN] pin: mcp23xxx: mcp23xxx_hub3_OUT number: 2 mode: OUTPUT inverted: False id: hub3_out2 restore_mode: ALWAYS_OFF - platform: gpio name: "hub3_out3" # Ogrzewanie Kuchnia pin: mcp23xxx: mcp23xxx_hub3_OUT number: 3 mode: OUTPUT inverted: False id: hub3_out3 restore_mode: ALWAYS_OFF - platform: gpio name: "hub3_out4" # Ogrzewanie Jadalnia/Salon pin: mcp23xxx: mcp23xxx_hub3_OUT number: 4 mode: OUTPUT inverted: False id: hub3_out4 restore_mode: ALWAYS_OFF - platform: gpio name: "hub3_out5" # Ogrzewanie Salon kanapa pin: mcp23xxx: mcp23xxx_hub3_OUT number: 5 mode: OUTPUT inverted: False id: hub3_out5 restore_mode: ALWAYS_OFF - platform: gpio name: "hub3_out6" # Ogrzewanie SPA pin: mcp23xxx: mcp23xxx_hub3_OUT number: 6 mode: OUTPUT inverted: False id: hub3_out6 restore_mode: ALWAYS_OFF - platform: gpio name: "hub3_out7" # Ogrzewanie Korytarz pin: mcp23xxx: mcp23xxx_hub3_OUT number: 7 mode: OUTPUT inverted: False id: hub3_out7 restore_mode: ALWAYS_OFF - platform: gpio name: "hub3_out8" # Ogrzewanie Pokój Dziecka 2 pin: mcp23xxx: mcp23xxx_hub3_OUT number: 8 mode: OUTPUT inverted: False id: hub3_out8 restore_mode: ALWAYS_OFF - platform: gpio name: "hub3_out9" # Ogrzewanie Biuro/Serwer pin: mcp23xxx: mcp23xxx_hub3_OUT number: 9 mode: OUTPUT inverted: False id: hub3_out9 restore_mode: ALWAYS_OFF - platform: gpio name: "hub3_out10" # Ogrzewanie Biuro pin: mcp23xxx: mcp23xxx_hub3_OUT number: 10 mode: OUTPUT inverted: False id: hub3_out10 restore_mode: ALWAYS_OFF - platform: gpio name: "hub3_out11" # Ogrzewanie Pokój Dziecka 1 pin: mcp23xxx: mcp23xxx_hub3_OUT number: 11 mode: OUTPUT inverted: False id: hub3_out11 restore_mode: ALWAYS_OFF - platform: gpio name: "hub3_out12" # Ogrzewanie Garderoba pin: mcp23xxx: mcp23xxx_hub3_OUT number: 12 mode: OUTPUT inverted: False id: hub3_out12 restore_mode: ALWAYS_OFF - platform: gpio name: "hub3_out13" # Ogrzewanie Sypialnia 2 pin: mcp23xxx: mcp23xxx_hub3_OUT number: 13 mode: OUTPUT inverted: False id: hub3_out13 restore_mode: ALWAYS_OFF - platform: gpio name: "hub3_out14" # Ogrzewanie Biała Łazienka/WC pin: mcp23xxx: mcp23xxx_hub3_OUT number: 14 mode: OUTPUT inverted: False id: hub3_out14 restore_mode: ALWAYS_OFF - platform: gpio name: "hub3_out15" # Ogrzewanie Sypialnia 1 pin: mcp23xxx: mcp23xxx_hub3_OUT number: 15 mode: OUTPUT inverted: False 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 # pin: # number: 39 # inverted: True # name: "Mains detector" ################## #mcp23xxx_hub1_IN# ################## - platform: gpio name: "hub1_in0" # Wejście 1 pin: mcp23xxx: mcp23xxx_hub1_IN 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: mcp23xxx: mcp23xxx_hub1_IN number: 1 mode: INPUT inverted: True filters: - delayed_on_off: 30ms id: hub1_in1 - platform: gpio name: "hub1_in2" # Wejście 2 pin: mcp23xxx: mcp23xxx_hub1_IN 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: mcp23xxx: mcp23xxx_hub1_IN 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: mcp23xxx: mcp23xxx_hub1_IN 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: mcp23xxx: mcp23xxx_hub1_IN 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: mcp23xxx: mcp23xxx_hub1_IN 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: mcp23xxx: mcp23xxx_hub1_IN 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" # 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" # 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: mcp23xxx: mcp23xxx_hub1_IN number: 10 mode: INPUT inverted: True filters: - delayed_on_off: 30ms id: hub1_in10 - platform: gpio name: "hub1_in11" # (niepodpięte) pin: mcp23xxx: mcp23xxx_hub1_IN number: 11 mode: INPUT inverted: True filters: - delayed_on_off: 30ms id: hub1_in11 - platform: gpio name: "hub1_in12" # (niepodpięte) pin: mcp23xxx: mcp23xxx_hub1_IN number: 12 mode: INPUT inverted: True filters: - delayed_on_off: 30ms id: hub1_in12 - platform: gpio name: "hub1_in13" # (niepodpięte) pin: mcp23xxx: mcp23xxx_hub1_IN number: 13 mode: INPUT inverted: True filters: - delayed_on_off: 30ms id: hub1_in13 - platform: gpio name: "hub1_in14" # (niepodpięte) pin: mcp23xxx: mcp23xxx_hub1_IN number: 14 mode: INPUT inverted: True filters: - delayed_on_off: 30ms id: hub1_in14 - platform: gpio name: "hub1_in15" # (niepodpięte) pin: mcp23xxx: mcp23xxx_hub1_IN number: 15 mode: INPUT inverted: True filters: - delayed_on_off: 30ms id: hub1_in15 ################## #mcp23xxx_hub2_IN# ################## - platform: gpio name: "hub2_in0" # Korytarz 2 pin: mcp23xxx: mcp23xxx_hub2_IN 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: mcp23xxx: mcp23xxx_hub2_IN 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: mcp23xxx: mcp23xxx_hub2_IN 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: mcp23xxx: mcp23xxx_hub2_IN 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: mcp23xxx: mcp23xxx_hub2_IN 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: mcp23xxx: mcp23xxx_hub2_IN 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: mcp23xxx: mcp23xxx_hub2_IN 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: mcp23xxx: mcp23xxx_hub2_IN 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: mcp23xxx: mcp23xxx_hub2_IN 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: mcp23xxx: mcp23xxx_hub2_IN 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: mcp23xxx: mcp23xxx_hub2_IN 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: mcp23xxx: mcp23xxx_hub2_IN 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: mcp23xxx: mcp23xxx_hub2_IN 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: mcp23xxx: mcp23xxx_hub2_IN 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: mcp23xxx: mcp23xxx_hub2_IN number: 14 mode: INPUT inverted: True filters: - delayed_on_off: 30ms id: hub2_in14 - platform: gpio name: "hub2_in15" # (niepodpięte) pin: mcp23xxx: mcp23xxx_hub2_IN number: 15 mode: INPUT inverted: True filters: - delayed_on_off: 30ms id: hub2_in15 ################## #mcp23xxx_hub3_IN# ################## - platform: gpio name: "hub3_in0" # Garderoba Duża Lewy pin: mcp23xxx: mcp23xxx_hub3_IN 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: mcp23xxx: mcp23xxx_hub3_IN number: 1 mode: INPUT inverted: True filters: - delayed_on_off: 30ms id: hub3_in1 - platform: gpio name: "hub3_in2" # SPA Lewy pin: mcp23xxx: mcp23xxx_hub3_IN 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: mcp23xxx: mcp23xxx_hub3_IN 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: mcp23xxx: mcp23xxx_hub3_IN 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: mcp23xxx: mcp23xxx_hub3_IN 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: mcp23xxx: mcp23xxx_hub3_IN 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: mcp23xxx: mcp23xxx_hub3_IN 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: mcp23xxx: mcp23xxx_hub3_IN 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: mcp23xxx: mcp23xxx_hub3_IN 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: mcp23xxx: mcp23xxx_hub3_IN 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: mcp23xxx: mcp23xxx_hub3_IN 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: mcp23xxx: mcp23xxx_hub3_IN 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: mcp23xxx: mcp23xxx_hub3_IN number: 13 mode: INPUT inverted: True filters: - delayed_on_off: 30ms id: hub3_in13 - platform: gpio name: "hub3_in14" # (niepodpięte) pin: mcp23xxx: mcp23xxx_hub3_IN number: 14 mode: INPUT inverted: True filters: - delayed_on_off: 30ms id: hub3_in14 - platform: gpio name: "hub3_in15" # (niepodpięte) pin: mcp23xxx: mcp23xxx_hub3_IN number: 15 mode: INPUT inverted: True filters: - delayed_on_off: 30ms id: hub3_in15 sensor: - platform: uptime type: seconds name: Uptime Sensor - platform: atc_mithermometer mac_address: "A4:C1:38:C5:11:58" temperature: name: "Biuro Temperatura" humidity: name: "Biuro Nawilżenie" battery_level: name: "Biuro Bateria" - platform: atc_mithermometer mac_address: "A4:C1:38:5C:4F:38" temperature: name: "Serwer Temperatura" humidity: name: "Serwer Nawilżenie" battery_level: name: "Serwer Bateria" - platform: atc_mithermometer mac_address: "A4:C1:38:67:6B:94" temperature: name: "Kuchnia Temperatura" humidity: name: "Kuchnia Nawilżenie" battery_level: name: "Kuchnia Bateria" - platform: atc_mithermometer mac_address: "A4:C1:38:C9:FE:CA" temperature: name: "WC Temperatura" humidity: name: "WC Nawilżenie" battery_level: name: "WC Bateria" - platform: atc_mithermometer mac_address: "A4:C1:38:63:6D:DB" temperature: name: "Łazienka Temperatura" humidity: name: "Łazienka Nawilżenie" battery_level: name: "Łazienka Bateria"