esphome:
  name: emporia-vue-utility

esp32:
  board: esp-wrover-kit
  framework:
    type: esp-idf

external_components:
  source:
    type: git
    url: https://github.com/nekorevend/esphome-emporia-vue-utility

# Enable logging
logger:

# Enable Home Assistant API
# Encryption secures it.  Any password will work.  See FAQ.
api:
  encryption:
    key: "some_password"

# Secures OTA Updates.  Any password will work.  See FAQ.
ota:
  platform: esphome
  password: "some_password"

wifi:
  ssid: !secret wifi_ssid
  password: !secret wifi_password

# Runs a webserver on http://emporia-vue-utility.local with no password
web_server:
  port: 80
# Optionally define a username + password
#  auth:
#    username: 'some_username'
#    password: 'your_password'

# This uart connects to the MGM111
uart:
  id: emporia_uart
  rx_pin: GPIO21
  tx_pin: GPIO22
  baud_rate: 115200

sensor:
  - platform: emporia_vue_utility
    uart_id: emporia_uart

    # Enables verbose logging.
    debug: true

    # The default update interval is 30s, but you can experiment with how frequent your smart meter
    # supports providing an updated value.
    # update_interval: 15s

    # Below is a reasonable setup for someone with solar/batteries, but if you do not have that
    # then you can remove the `energy_export` sensor and keep either `energy` or `energy_import`.
    # All of the sensors are optional, so keep the ones you are interested in.
    power:
      name: "Watts"
    # power_export:
    #   name: "Watts Returned"
    # power_import:
    #   name: "Watts Consumed"
    energy:
      name: "Wh Net"
    energy_export:
      name: "Wh Returned"
    energy_import:
      name: "Wh Consumed"

# This LED is marked D3 on the pcb and is the power led on the case
status_led:
  pin:
    number: GPIO25
    # It *is* inverted, but being normally on looks better
    inverted: false
