• Home

  • Products

    • Local Shipping
    • Tasmota
    • ESPHome
    • WLED
    • Homekit
    • Home Bridge
  • Forum

  • About Shipping

  • Contact Us

  • 更多

    Use tab to navigate through the menu items.
    0
    Para ver esto en acción, dirígete a tu sitio ya publicado.
    • Categorías
    • Todas las entradas
    • Mis entradas
    Martin Leonard
    07 feb 2021

    Here is an ESPHome config for the UK Power Plug

    en Plugs

    you may need to tweak current_res and voltage_div for your local power


    substitutions:
      devicename: athomsmartplug
      upper_devicename: Athom Smart Plug
        # Higher value gives lower watt readout
      current_res: "0.00225"
      # Lower value gives lower voltage readout
      voltage_div: "757"
    
    esphome:
      name: $devicename
      platform: ESP8266
      board: esp01_1m
    
    wifi:
      ssid: !secret wifi_ssid
      password: !secret wifi_password
    
      # Enable fallback hotspot (captive portal) in case wifi connection fails
      ap:
        ssid: "${upper_devicename} Hotspot"
        password: ""
    
    captive_portal:
    
    # Enable logging
    logger:
    
    # Enable Home Assistant API
    api:
    
    ota:
    
    web_server:
      port: 80
    
    # Time used for daily KWh usage  
    time:
      - platform: homeassistant
        id: homeassistant_time
    
    status_led:
      pin:
        number: GPIO0
        inverted: yes
    
    binary_sensor:
        # Button 1 configuration
      - platform: gpio
        pin:
          number: GPIO3
          mode: INPUT_PULLUP
          inverted: True
        id: button_1
        on_press:
          then:
            - switch.toggle: relay_1
        on_click:
          min_length: 5000ms
          max_length: 10000ms
          then:
            - switch.turn_on: reset
      - platform: status
        name: "${upper_devicename} Status"
    
    switch: # Set relays as switches
      - platform: gpio
        id: relay_1
        icon: mdi:power-socket-uk
        pin: GPIO14
        name: "${upper_devicename} Switch"
        on_turn_on:
        - switch.turn_on: sw_led1
        on_turn_off:
        - switch.turn_off: sw_led1
      # Register LED on GPIO
      - platform: gpio
        id: sw_led1
        pin: GPIO13
        inverted: True
      - platform: restart
        name: "${upper_devicename} Restart"
        id: reset
    
    sensor:
      - platform: hlw8012
        sel_pin:
          number: GPIO12
          inverted: True
        cf_pin: GPIO04
        cf1_pin: GPIO5
        current_resistor: ${current_res}
        voltage_divider: ${voltage_div}
        current:
          name: "${upper_devicename} Amperage"
          unit_of_measurement: A
          accuracy_decimals: 3
          icon: mdi:flash-circle
        voltage:
          name: "${upper_devicename} Voltage"
          unit_of_measurement: V
          icon: mdi:flash-circle
        power:
          name: "${upper_devicename} Wattage"
          unit_of_measurement: W
          id: "${devicename}_Wattage"
          icon: mdi:flash-circle
        change_mode_every: 4
        update_interval: 10s
      - platform: total_daily_energy
        name: "${upper_devicename} Total Daily Energy"
        power_id: "${devicename}_Wattage"
        filters:
            # Multiplication factor from W to kW is 0.001
            - multiply: 0.001
        unit_of_measurement: kWh
        icon: mdi:clock-alert
      - platform: uptime
        name: "${upper_devicename} Uptime"
        icon: mdi:clock-outline
      - platform: wifi_signal
        name: "${upper_devicename} Wifi Signal"
        update_interval: 60s
    
    


    1 comentario
    1 comentario

    Comparte lo que piensasRegístrate para dejar un comentario.

    M
    Mickaël Garabello
    Mickaël Garabello
    25 abr 2021

    Thanks a lot, really appreciate the cleanliness ! You've just changed my default template for all my devices lmao

    Me gusta
    1 comentario
    Entradas similares
    • E27 15W RGBCCT bulb ESPHome config
    • Can't upload ESPHome to US Plug "Upload buffer miscompare"
    • esphome example config for sw032us two button touch switch

    ©2020 by athom.