Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- esphome:
- name: kotela6
- friendly_name: KotelA6
- libraries:
- - "Wire"
- - "uFire SHT20"
- - "ArduinoJson"
- includes:
- - includes/sht20.h
- esp32:
- board: esp32dev
- framework:
- type: arduino
- wifi:
- ssid: !secret wifi_ssid
- password: !secret wifi_password
- logger:
- api:
- encryption:
- key: "dmnpt0Z87/XJP5FIZRYK3lAusBjLBkybSUU5o8kkPJo="
- captive_portal:
- ota:
- password: "8d615cc4929798ff5139d001f2f6e7fc"
- #########################
- uart:
- - id: ubus1
- tx_pin: GPIO13
- rx_pin: GPIO12
- baud_rate: 9600
- stop_bits: 1
- i2c:
- sda: GPIO4
- scl: GPIO15 # Change SCL to GPIO22 to avoid issues with GPIO15
- scan: true
- ##########################
- pcf8574:
- - id: 'pcf8574_hub_out_1' # for output channel 1-8
- address: 0x24
- - id: 'pcf8574_hub_in_1' # for input channel 9-16
- address: 0x22
- pcf8575: false
- #####################
- time:
- - platform: ds1307
- id: rtc_time
- sensor:
- #### PZEM-004T V3 ####
- - platform: pzemac
- address: 1
- current:
- name: "pMeter_current"
- accuracy_decimals: 2
- voltage:
- name: "pMeter_voltage"
- accuracy_decimals: 2
- power:
- name: "pMeter_power"
- unit_of_measurement: W
- accuracy_decimals: 2
- id: pMeter_power
- frequency:
- name: "pMeter_frequency"
- unit_of_measurement: Hz
- accuracy_decimals: 2
- power_factor:
- name: "pMeter_power_factor"
- accuracy_decimals: 2
- id: pMeter_power_factor
- energy:
- name: "pMeter_energy"
- unit_of_measurement: Wh
- accuracy_decimals: 1
- id: pMeter_energy
- update_interval: 5s
- - platform: template
- name: "pMeter_cumulative power"
- unit_of_measurement: "kWh"
- accuracy_decimals: 1
- update_interval: 5s
- icon: mdi:power
- lambda: return (( (id(pMeter_energy).state)/1000.0));
- - platform: total_daily_energy
- name: "pMeter_of_day"
- power_id: pMeter_power
- unit_of_measurement: "kWh"
- accuracy_decimals: 2
- id: pMeter_power_of_day
- filters:
- # Multiplication factor from W to kW is 0.001
- - multiply: 0.001
- icon: mdi:counter
- - platform: template
- name: "pMeter_veille"
- id: template_pMeter_veille
- unit_of_measurement: "kwh"
- accuracy_decimals: 2
- icon: mdi:power
- update_interval: 10s
- - platform: template
- name: "pMeter_power_apparente"
- id: pMeter_power_apparente
- unit_of_measurement: "VA"
- accuracy_decimals: 2
- update_interval: 10s
- icon: mdi:power
- lambda: return ( (id(pMeter_power).state/id(pMeter_power_factor).state));
- - platform: template
- name: "pMeter_power_reactive"
- id: pMeter_power_reactive
- unit_of_measurement: "VAr"
- accuracy_decimals: 2
- update_interval: 10s
- icon: mdi:power
- lambda: return ( ( sqrt( (id(pMeter_power_apparente).state)*(id(pMeter_power_apparente).state) - (id(pMeter_power).state)*(id(pMeter_power).state) ) ) );
- - platform: wifi_signal
- name: "WiFi power_pMeter"
- update_interval: 10s
- - platform: uptime
- name: "up"
- id: uptime_sec
- text_sensor:
- - platform: template
- name: pMeter_uptime
- lambda: |-
- int seconds = (id(uptime_sec).state);
- int days = seconds / (24 * 3600);
- seconds = seconds % (24 * 3600);
- int hours = seconds / 3600;
- seconds = seconds % 3600;
- int minutes = seconds / 60;
- seconds = seconds % 60;
- return { (String(days) +"d " + String(hours) +"h " + String(minutes) +"m "+ String(seconds) +"s").c_str() };
- icon: mdi:clock-start
- update_interval: 113s
- ################################################# SENSOR
- binary_sensor:
- - platform: status
- name: "pMeter_status"
- - platform: gpio
- name: "flood_elling"
- icon: mdi:home-flood
- pin:
- pcf8574: pcf8574_hub_in_1
- number: 0
- mode: INPUT
- inverted: true
- - platform: gpio
- name: "flood_pool"
- icon: mdi:home-flood
- pin:
- pcf8574: pcf8574_hub_in_1
- number: 1
- mode: INPUT
- inverted: true
- - platform: gpio
- name: "flood_pump"
- icon: mdi:home-flood
- pin:
- pcf8574: pcf8574_hub_in_1
- number: 2
- mode: INPUT
- inverted: true
- - platform: gpio
- name: "KC868-A6-IN-4"
- pin:
- pcf8574: pcf8574_hub_in_1
- number: 3
- mode: INPUT
- inverted: true
- - platform: gpio
- name: "KC868-A6-IN-5"
- pin:
- pcf8574: pcf8574_hub_in_1
- number: 4
- mode: INPUT
- inverted: true
- - platform: gpio
- name: "KC868-A6-IN-6"
- pin:
- pcf8574: pcf8574_hub_in_1
- number: 5
- mode: INPUT
- inverted: true
- ################################################# RELAYS
- switch:
- - platform: restart
- name: "pMeter_restart"
- ### KINCONY 1
- - platform: gpio
- name: "Boiler ten"
- id: relay_1
- icon: mdi:fan
- pin:
- pcf8574: pcf8574_hub_out_1
- number: 0
- mode: OUTPUT
- inverted: true
- - platform: gpio
- name: "free"
- id: relay_2
- pin:
- pcf8574: pcf8574_hub_out_1
- number: 1
- mode: OUTPUT
- inverted: true
- ########################### ######### BOILER PUMP
- - platform: gpio
- name: "Boiler Pump"
- icon: mdi:pump
- id: relay_3
- pin:
- pcf8574: pcf8574_hub_out_1
- number: 2
- mode: OUTPUT
- inverted: true
- ################################## #RECIRCULATE
- - platform: gpio
- name: "Recirculate Pump"
- icon: mdi:pump
- id: relay_4
- pin:
- pcf8574: pcf8574_hub_out_1
- number: 3
- mode: OUTPUT
- inverted: true
- ######################## INTERLOCK WATER STOP ###########################
- - platform: gpio
- name: "HouseWater OFF"
- icon: mdi:water-off-outline
- id: relay_5
- pin:
- pcf8574: pcf8574_hub_out_1
- number: 4
- mode: OUTPUT
- inverted: true
- interlock: [relay_6] # Interlock with Grow Pump_6
- - platform: gpio
- name: "HouseWater ON"
- icon: mdi:water
- id: relay_6
- pin:
- pcf8574: pcf8574_hub_out_1
- number: 5
- mode: OUTPUT
- inverted: true
- interlock: [relay_5]
- restore_mode: ALWAYS_ON
Advertisement
Add Comment
Please, Sign In to add comment