Skip to content
Snippets Groups Projects
Select Git revision
2 results Searching

nous_a1t.yaml

Blame
  • nous_a1t.yaml 1.57 KiB
    esp8266:
      board: esp8285
    
    time:
      - platform: sntp
        id: sntp_time
        timezone: "Europe/Berlin"
        update_interval: 1h
    
    light:
      - platform: status_led
        id: led_status
        pin:
          number: GPIO13
          inverted: true
    
    binary_sensor:
      # toggle relay on/off
      - platform: gpio
        id: button_state
        pin:
          number: GPIO00
          mode: INPUT_PULLUP
        on_press:
          - switch.toggle: power
    
    switch:
      - platform: template
        name: "Power"
        optimistic: true
        id: power
        lambda: |-
          if (id(relay).state) {
            return true;
          } else {
            return false;
          }
        turn_on_action:
          - switch.turn_on: relay
          - light.turn_on: led_status
        turn_off_action:
          - switch.turn_off: relay
          - light.turn_off: led_status
      - platform: gpio
        id: relay
        pin: GPIO14
    
    sensor:
      - platform: total_daily_energy
        name: "Daily Consumption"
        power_id: watt
        filters:
          # Multiplication factor from W to kW is 0.001
          - multiply: 0.001
        unit_of_measurement: kWh
    
      - platform: adc
        pin: VCC
        name: "VCC Volt"
    
      - platform: hlw8012
        sel_pin:
          number: GPIO12
          inverted: True
        cf_pin: GPIO04
        cf1_pin: GPIO05
        change_mode_every: 4
        current_resistor: ${current_res}
        voltage_divider: ${voltage_div}
        update_interval: 3s