Skip to content

Solar Router using a proxy

The configuration of the Proxy client is only using a Home Assistant power meter

# ----------------------------------------------------------------------------------------------------
# ESPHome configuration - This part depends on your hardware target
# ----------------------------------------------------------------------------------------------------

esphome:
  name: "esp8285"
  friendly_name: ESP8285

esp8266:
  board: esp8285

# Enable logging
logger:
  baud_rate: 115200
  level: INFO
  logs:
    component: ERROR
    http_request.arduino: ERROR

# Enable Home Assistant API
api:
  encryption:
    key: !secret proxy_api_encryption_key

# Enable over-the-air updates
ota:
  - platform: esphome

# WiFi connection
wifi:
  ssid: !secret wifi_ssid
  password: !secret wifi_password
  # If you have a WiFi activity plannification, you may have to update the reboot timeout (Default: 15min)
  reboot_timeout: 24h

# ----------------------------------------------------------------------------------------------------
# Customisation
# ----------------------------------------------------------------------------------------------------

substitutions:
  # Power meter source -----------------------------------------------------------
  # Define ip address of Shelly EM probe
  power_meter_ip_address: "192.168.1.26:8000"
  emeter_index: "0"

  # LEDs -------------------------------------------------------------------------
  # Yellow LED is reflecting power meter
  yellow_led_pin: GPIO1

# power_meter_activated has to be set to 1 to activate the power measurment read
globals:
  - id: power_meter_activated
    type: int
    initial_value: "1"

# Uncomment the following lines if you want to use the source from github
# packages:
#   power_meter:
#     url: https://github.com/XavierBerger/Solar-Router-for-ESPHome/
#     file: solar_router/power_meter_shelly_em.yaml
#     refresh: 5s

# Remove the following lines if you want to use the source from github
packages:
  common:
    <<: !include solar_router/common.yaml
  power_meter:
    <<: !include solar_router/power_meter_shelly_em.yaml

http_request:
  esp8266_disable_ssl_support: True

This configuration the Solar Router is using Proxy client power meter, Triac regulator and Solar router engine.

GPIO pins have been defined to match hardware configuration described here

# ----------------------------------------------------------------------------------------------------
# ESPHome configuration - This part depends on your hardware target
# ----------------------------------------------------------------------------------------------------

esphome:
  name: solarrouter
  friendly_name: SolarRouter

esp32:
  board: esp32dev
  framework:
    type: arduino

# Enable logging
logger:
  baud_rate: 115200
  level: INFO
  logs:
    component: ERROR

# Enable Home Assistant API
api:
  encryption:
    key: !secret api_encryption_key

# Enable over-the-air updates
ota:
  - platform: esphome
    password: !secret solar_router_ota_password

# Enable improv serial
improv_serial:

# WiFi connection
wifi:
  ssid: !secret wifi_ssid
  password: !secret wifi_password
  # If you have a WiFi activity plannification, you may have to update the reboot timeout (Default: 15min)
  reboot_timeout: 24h

# Activate web interface
web_server:
  port: 80

# ----------------------------------------------------------------------------------------------------
# Customisation
# ----------------------------------------------------------------------------------------------------

# This part of the script is designed to be use for customisation. It shouldn't be necessary to
# edit other part of the script to perform configuration.
substitutions:
  # Power meter source -----------------------------------------------------------
  # Define ip address of Proxy Power Meter
  power_meter_ip_address: "192.168.1.30"

  # Regulator --------------------------------------------------------------------
  regulator: "ac_dimmer"

  # Regulator configuration 
  # Define GPIO pin connected to AC Dimmer for gate and zero crossing detection.
  regulator_gate_pin: GPIO22
  regulator_zero_crossing_pin: GPIO23

  # LEDs -------------------------------------------------------------------------
  # Green LED is reflecting regulation status
  # Yellow LED is reflecting power meter status
  green_led_pin: GPIO19
  yellow_led_pin: GPIO18

# Uncomment the following lines if you want to use the source from github
# packages:
#   power_meter:
#     url: https://github.com/XavierBerger/Solar-Router-for-ESPHome/
#     file: solar_router/power_meter_proxy_client.yaml
#     refresh: 5s
#   regulator:
#     url: https://github.com/XavierBerger/Solar-Router-for-ESPHome/
#     file: solar_router/regulator_triac.yaml
#     refresh: 5s
#   solar_router:
#     url: https://github.com/XavierBerger/Solar-Router-for-ESPHome/
#     file: solar_router/engine.yaml
#     refresh: 5s

# Remove the following lines if you want to use the source from github
packages:
  common:
    <<: !include solar_router/common.yaml
  power_meter:
    <<: !include solar_router/power_meter_proxy_client.yaml
  regulator:
    <<: !include solar_router/regulator_triac.yaml
  solar_router:
    <<: !include solar_router/engine.yaml
  energy_counter: 
    <<: !include solar_router/energy_counter_theorical.yaml