sphome: name: a16v3 friendly_name: a16v3 platformio_options: board_build.flash_mode: dio esp32: board: esp32-s3-devkitc-1 framework: type: esp-idf # Enable logging logger: hardware_uart: USB_SERIAL_JTAG api: ota: - platform: esphome password: ethernet: type: W5500 clk_pin: GPIO42 mosi_pin: GPIO43 miso_pin: GPIO44 cs_pin: GPIO15 interrupt_pin: GPIO2 reset_pin: GPIO1 i2c: - id: bus_a sda: 9 scl: 10 scan: true frequency: 400kHz # Example configuration entry pcf8574: - id: 'pcf8574_hub_out_1' # for output channel 1-8 address: 0x24 - id: 'pcf8574_hub_out_2' # for output channel 9-16 address: 0x25 - id: 'pcf8574_hub_in_1' # for input channel 1-8 address: 0x21 - id: 'pcf8574_hub_in_2' # for input channel 9-16 address: 0x22 uart: - id: uart_1 baud_rate: 9600 debug: direction: BOTH dummy_receiver: true after: timeout: 10ms tx_pin: 16 rx_pin: 17 switch: - platform: gpio name: "Sygnalizator SPW-220R" icon: mdi:bullhorn pin: pcf8574: pcf8574_hub_out_1 number: 0 mode: OUTPUT inverted: true restore_mode: ALWAYS_OFF # Pozostałe wyjścia DO2-DO16 (opcjonalnie użyj według potrzeb) - platform: gpio name: "a16v3_output2" pin: pcf8574: pcf8574_hub_out_1 number: 1 mode: OUTPUT inverted: true restore_mode: RESTORE_DEFAULT_OFF - platform: gpio name: "a16v3_output3" pin: pcf8574: pcf8574_hub_out_1 number: 2 mode: OUTPUT inverted: true restore_mode: RESTORE_DEFAULT_OFF - platform: gpio name: "a16v3_output4" pin: pcf8574: pcf8574_hub_out_1 number: 3 mode: OUTPUT inverted: true restore_mode: RESTORE_DEFAULT_OFF - platform: gpio name: "a16v3_output5" pin: pcf8574: pcf8574_hub_out_1 number: 4 mode: OUTPUT inverted: true restore_mode: RESTORE_DEFAULT_OFF - platform: gpio name: "a16v3_output6" pin: pcf8574: pcf8574_hub_out_1 number: 5 mode: OUTPUT inverted: true restore_mode: RESTORE_DEFAULT_OFF - platform: gpio name: "a16v3_output7" pin: pcf8574: pcf8574_hub_out_1 number: 6 mode: OUTPUT inverted: true restore_mode: RESTORE_DEFAULT_OFF - platform: gpio name: "a16v3_output8" pin: pcf8574: pcf8574_hub_out_1 number: 7 mode: OUTPUT inverted: true restore_mode: RESTORE_DEFAULT_OFF - platform: gpio name: "a16v3_output9" pin: pcf8574: pcf8574_hub_out_2 number: 0 mode: OUTPUT inverted: true restore_mode: RESTORE_DEFAULT_OFF - platform: gpio name: "a16v3_output10" pin: pcf8574: pcf8574_hub_out_2 number: 1 mode: OUTPUT inverted: true restore_mode: RESTORE_DEFAULT_OFF - platform: gpio name: "a16v3_output11" pin: pcf8574: pcf8574_hub_out_2 number: 2 mode: OUTPUT inverted: true restore_mode: RESTORE_DEFAULT_OFF - platform: gpio name: "a16v3_output12" pin: pcf8574: pcf8574_hub_out_2 number: 3 mode: OUTPUT inverted: true restore_mode: RESTORE_DEFAULT_OFF - platform: gpio name: "a16v3_output13" pin: pcf8574: pcf8574_hub_out_2 number: 4 mode: OUTPUT inverted: true restore_mode: RESTORE_DEFAULT_OFF - platform: gpio name: "a16v3_output14" pin: pcf8574: pcf8574_hub_out_2 number: 5 mode: OUTPUT inverted: true restore_mode: RESTORE_DEFAULT_OFF - platform: gpio name: "a16v3_output15" pin: pcf8574: pcf8574_hub_out_2 number: 6 mode: OUTPUT inverted: true restore_mode: RESTORE_DEFAULT_OFF - platform: gpio name: "a16v3_output16" pin: pcf8574: pcf8574_hub_out_2 number: 7 mode: OUTPUT inverted: true restore_mode: RESTORE_DEFAULT_OFF # ------------------------- # Wejścia DI1-DI16 # DI1-DI10 = kontaktrony K-2 2E (door/window) # DI11-DI16 = czujki PIR 2EOL/NC # ------------------------- binary_sensor: # Kontaktrony DI1-DI8 (pcf8574_hub_in_1) - platform: gpio name: "Kontaktron DI1 Drzwi Głowne" device_class: door pin: pcf8574: pcf8574_hub_in_1 number: 0 mode: INPUT inverted: true filters: - delayed_on: 50ms - delayed_off: 50ms - platform: gpio name: "Kontaktron DI2 Okno Salon" device_class: window pin: pcf8574: pcf8574_hub_in_1 number: 1 mode: INPUT inverted: true filters: - delayed_on: 50ms - delayed_off: 50ms - platform: gpio name: "Kontaktron DI3 Okno Kuchnia" device_class: window pin: pcf8574: pcf8574_hub_in_1 number: 2 mode: INPUT inverted: true filters: - delayed_on: 50ms - delayed_off: 50ms - platform: gpio name: "Kontaktron DI4 Drzwi Taras" device_class: door pin: pcf8574: pcf8574_hub_in_1 number: 3 mode: INPUT inverted: true filters: - delayed_on: 50ms - delayed_off: 50ms - platform: gpio name: "Kontaktron DI5 Okno Gabinet" device_class: window pin: pcf8574: pcf8574_hub_in_1 number: 4 mode: INPUT inverted: true filters: - delayed_on: 50ms - delayed_off: 50ms - platform: gpio name: "Kontaktron DI6 Okno Łazienka" device_class: window pin: pcf8574: pcf8574_hub_in_1 number: 5 mode: INPUT inverted: true filters: - delayed_on: 50ms - delayed_off: 50ms - platform: gpio name: "Kontaktron DI7 Drzwi Garaż" device_class: door pin: pcf8574: pcf8574_hub_in_1 number: 6 mode: INPUT inverted: true filters: - delayed_on: 50ms - delayed_off: 50ms - platform: gpio name: "Kontaktron DI8 Okno Sypialnia" device_class: window pin: pcf8574: pcf8574_hub_in_1 number: 7 mode: INPUT inverted: true filters: - delayed_on: 50ms - delayed_off: 50ms # Kontaktrony DI9-DI10 (pcf8574_hub_in_2, piny 0-1) - platform: gpio name: "Kontaktron DI9 Drzwi Piętro" device_class: door pin: pcf8574: pcf8574_hub_in_2 number: 0 mode: INPUT inverted: true - platform: gpio name: "Kontaktron DI10 Okno Wiatrolap" device_class: window pin: pcf8574: pcf8574_hub_in_2 number: 1 mode: INPUT inverted: true filters: - delayed_on: 50ms - delayed_off: 50ms # Czujki PIR DI11-DI16 (pcf8574_hub_in_2, piny 2-7) - platform: gpio name: "PIR DI11 Salon" device_class: motion pin: pcf8574: pcf8574_hub_in_2 number: 2 mode: INPUT inverted: true filters: - delayed_on: 100ms - delayed_off: 3s - platform: gpio name: "PIR DI12 Korytarz" device_class: motion pin: pcf8574: pcf8574_hub_in_2 number: 3 mode: INPUT inverted: true filters: - delayed_on: 100ms - delayed_off: 3s - platform: gpio name: "PIR DI13 Kuchnia" device_class: motion pin: pcf8574: pcf8574_hub_in_2 number: 4 mode: INPUT inverted: true filters: - delayed_on: 100ms - delayed_off: 3s - platform: gpio name: "PIR DI14 Sypialnia" device_class: motion pin: pcf8574: pcf8574_hub_in_2 number: 5 mode: INPUT inverted: true filters: - delayed_on: 100ms - delayed_off: 3s - platform: gpio name: "PIR DI15 Łazienka" device_class: motion pin: pcf8574: pcf8574_hub_in_2 number: 6 mode: INPUT inverted: true filters: - delayed_on: 100ms - delayed_off: 3s - platform: gpio name: "PIR DI16 Garaż" device_class: motion pin: pcf8574: pcf8574_hub_in_2 number: 7 mode: INPUT inverted: true filters: - delayed_on: 100ms - delayed_off: 3s sensor: - platform: adc pin: 4 name: "A16v3 A1 Voltage" update_interval: 5s attenuation: 11db filters: - lambda: |- if (x >= 3.11) { return x * 1.60256; } else if (x <= 0.15) { return 0; } else { return x * 1.51; } - platform: adc pin: 6 name: "A16v3 A2 Voltage" update_interval: 5s attenuation: 11db filters: - lambda: |- if (x >= 3.11) { return x * 1.60256; } else if (x <= 0.15) { return 0; } else { return x * 1.51; } - platform: adc pin: 7 name: "A16v3 A3 Current" unit_of_measurement: mA update_interval: 5s attenuation: 11db filters: - multiply: 6.66666666 - platform: adc pin: 5 name: "A16v3 A4 Current" unit_of_measurement: mA update_interval: 5s attenuation: 11db filters: - multiply: 6.66666666 web_server: port: 80