Untitled

mail@pastecode.io avatar
unknown
yaml
3 years ago
5.1 kB
9
Indexable
Never
esphome:
  name: pec
  platform: ESP8266
  board: d1_mini

# Enable logging
logger:

# Enable Home Assistant API
api:

ota:
  password: "*"

wifi:
  ssid: "Wifi_Lackoma"
  password: "*****"

  # Enable fallback hotspot (captive portal) in case wifi connection fails
  ap:
    ssid: "Pec Fallback Hotspot"
    password: "****"

captive_portal:



web_server:
  port: 80

dallas:
  - pin: D7
    update_interval: 10s
  
sensor:
  - platform: dallas
    address: "0x57B8AD011E64FF28"
    name: "Pec OUT"
    icon: mdi:thermometer-chevron-up
    unit_of_measurement: °C
    device_class: "temperature"
    id: pec_out
    filters:
      - filter_out: nan
      - lambda: |-
          float MIN_VALUE = 5.0;
          float MAX_VALUE = 80.0;
          if (MIN_VALUE <= x && x <= MAX_VALUE) return x;
          else return {};
  - platform: dallas
    address: "0xB138D3011E64FF28"
    name: "Pec IN"
    icon: mdi:thermometer-chevron-down
    unit_of_measurement: °C
    device_class: "temperature"
    id: pec_in
    filters:
      - filter_out: nan
      - lambda: |-
          float MIN_VALUE = 5.0;
          float MAX_VALUE = 80.0;
          if (MIN_VALUE <= x && x <= MAX_VALUE) return x;
          else return {};
  - platform: dallas
    address: "0x5F3C01B556937828"
    name: "Pec komín"
    icon: mdi:home-roof
    unit_of_measurement: °C
    device_class: "temperature"
    id: pec_komin
    filters:
      - filter_out: nan
      - lambda: |-
          float MIN_VALUE = 0.0;
          float MAX_VALUE = 130.0;
          if (MIN_VALUE <= x && x <= MAX_VALUE) return x;
          else return {};
  - platform: dallas
    address: "0xF93C01F096A31C28"
    name: "Pec teplota v krabičke"
    icon: mdi:thermometer
    unit_of_measurement: °C
    device_class: "temperature"
    id: pec_krabicka
    filters:
      - filter_out: nan
      - lambda: |-
          float MIN_VALUE = 5.0;
          float MAX_VALUE = 80.0;
          if (MIN_VALUE <= x && x <= MAX_VALUE) return x;
          else return {};
  - platform: homeassistant
    entity_id: sensor.sonoff_1000bccd2b_temperature
    id: teplota
  - platform: homeassistant
    entity_id: sensor.cerpadlo_percent
    id: cerpadlo_percent
  - platform: template
    id: rozdiel
    unit_of_measurement: °C
    device_class: "temperature"
    update_interval: 5s
    lambda: 'return id(pec_out).state - id(pec_in).state;'
    filters:
      - filter_out: nan

binary_sensor:
  - platform: template
    name: "Horí v peci"
    lambda: |-
      if (id(pec_komin).state > 35) {
        // komin je teplejsi ako 35.
        return true;
      } else {
        // komin je chladnejši ako 35
        return false;
      }
  - platform: homeassistant
    name: "Stav čerpadla"
    entity_id: light.cerpadlo_pec
    id: stavcerpadla
#tlačitko 1
  - platform: gpio
    pin: 
      number: GPIO3
      inverted: true
      mode:
        input: true
        pullup: true
    filters:
    - delayed_on: 10ms
    name: "Tlačitko 1"
    device_class: window
    id: tlacitko1
    
#tlačitko 2
  - platform: gpio
    pin: 
      number: GPIO1
      inverted: true
      mode:
        input: true
        pullup: true
    filters:
    - delayed_on: 10ms
    name: "Tlačitko 2"
    device_class: window
    id: tlacitko2
   
#tlačitko 3
  - platform: gpio
    pin: 
      number: GPIO2
      inverted: true
      mode:
        input: true
        pullup: true
    filters:
    - delayed_on: 10ms
    name: "Tlačitko 3"
    device_class: window
    id: tlacitko3
    on_press:
      then:
        - lambda: |-
            id(backlight).publish_state(true);
            id(backlight).publish_state(false);
  - platform: template
    id: backlight
    filters:
    - delayed_off: 30s
    on_press:
      then:
        - lambda: |-
            id(mydisplay).backlight();
    on_release:
      then:
        - lambda: |-
            id(mydisplay).no_backlight();

switch:
  - platform: restart
    name: Reštart čidiel pec
  - platform: gpio
    name: "Zásuvka pec"
    icon: mdi:power-socket-fr
    restore_mode: RESTORE_DEFAULT_ON
    pin: D8
    id: rele

output:
  - platform: ac_dimmer
    id: dimmer1
    gate_pin: D5
    min_power: 0.4
    method: trailing
    zero_cross_pin:
      number: D6
      mode: INPUT
      inverted: yes

light:
  - platform: monochromatic
    output: dimmer1
    name: Čerpadlo pec
    id: cerpadlo

i2c:
  sda: GPIO4
  scl: GPIO5
  scan: true

display:
  - platform: lcd_pcf8574
    dimensions: 16x2
    address: 0x27
    id: mydisplay
    lambda: |-
      it.printf(0, 0,"%1.1f", id(pec_out).state);
      it.printf(7, 0,"%1.1f", id(teplota).state);
      it.printf(12, 0,"%1.1f", id(pec_in).state);
      it.printf(0, 1,"%4.1f", id(rozdiel).state);
      it.printf(5, 1,"%4.0f", id(cerpadlo_percent).state);
      it.printf(11, 1,"%5.1f", id(pec_komin).state);
      it.print(9, 1, "%");
time:
- platform: sntp
  id: my_time

text_sensor:
  - platform: version
    name: Pec ESPHome version
  - platform: wifi_info
    ip_address:
      name: Pec IP Address
    ssid:
      name: Pec Connected SSID 
    bssid:
      name: Pec BSSID    dfgsd