diff --git a/docs/about.md b/docs/about.md index 4cf45f2..d4d4d59 100644 --- a/docs/about.md +++ b/docs/about.md @@ -1,8 +1,9 @@ # About Early 2024, I built a solar router following the instruction of [F1ATB](https://f1atb.fr) ![france](images/france.png). This solar router is very versatil but I was not satisfy about the integration with [HomeAssistant](https://homeassistant.io). -I then found the job made by [Rem81](https://domo.rem81.com/) ![france](images/france.png) who create a solar router directly [ESPHome](https://esphome.io) and I thought it was certainly possible to have the modularity of F1ATB router with the level of integration in HomeAssistant of an ESPHome device... and this project was born. +I then found the job made by [Rem81](https://domo.rem81.com/) ![france](images/france.png) who create a solar router directly [ESPHome](https://esphome.io) and I thought it was certainly possible to have the modularity of F1ATB router with the level of integration in Home Assistant of an ESPHome device... and this project was born. ### Authors -- [@XavierBerger](https://github.com/XavierBerger) - Creator of Solar Router for ESPHome \ No newline at end of file +- [@XavierBerger](https://github.com/XavierBerger) - Creator of Solar Router for ESPHome +- [@tikismoke](https://github.com/tikismoke) : Home Assistant power meter first prototype \ No newline at end of file diff --git a/docs/contributing.md b/docs/contributing.md index b3fe9fd..c00518d 100644 --- a/docs/contributing.md +++ b/docs/contributing.md @@ -49,7 +49,7 @@ A documentation have to be added describing the power meter and how to configure A **Regulator** has to manage the energy sent to the load based on the `regulator_opening` sensor state. `regulator_opening` state can vary from 0 (where no energy is sent to the load) to 100 (where all the energy possible is sent to the load). -The following code represent and example (extracted from [regulator_triac.yaml](https://github.com/XavierBerger/Solar-Router-for-ESPHome/blob/main/solar_router/regulator_triac.yaml)) of usage based on `light` component using `brightness` to control the energy diverted: +The following code represent an example (extracted from [regulator_triac.yaml](https://github.com/XavierBerger/Solar-Router-for-ESPHome/blob/main/solar_router/regulator_triac.yaml)) of usage based on `light` component using `brightness` to control the energy diverted: ```yaml linenums="1" script: @@ -80,4 +80,4 @@ To install `mkdocs`, you need to install [Python](https://python.org) and then : Documentation is stored in `docs` directory. To see you modification in real time in your browser, execute the command `mkdocs serve` and browse [http://127.0.0.1:8000](http://127.0.0.1:8000) -{% include "changelog.md"%} \ No newline at end of file +{% include "changelog.md"%} diff --git a/docs/index.md b/docs/index.md index f63e86c..ec77c65 100644 --- a/docs/index.md +++ b/docs/index.md @@ -1,6 +1,6 @@ # Solar Router for ESPHome -The **Solar Router for ESPHome** is a DIY project aiming to provide specialized hardware device and software tailored for optimizing solar energy utilization. It performs real-time monitoring and intelligent surplus energy management to effectively channels excess solar energy to designated loads like water heaters or frost protection systems. +**Solar Router for ESPHome** is a DIY project aiming to provide specialized hardware device and software tailored for optimizing solar energy utilization. It performs real-time monitoring and intelligent surplus energy management to effectively channels excess solar energy to designated loads like water heaters or frost protection systems. Key features include dynamic energy routing algorithms, a choice of power meter source (local or remote ...), multiple regulators (with triac or relay ... ), and a seamless integration with [HomeAssistant](http://home-assistant.io) via [ESPHome](http://esphome.io) firmware. @@ -10,6 +10,10 @@ This integration enables users to effortlessly monitor and control the router's This project involves working with high voltage (110 or 230 volts), which can be hazardous. Please read the [disclaimer](disclamer.md) before proceeding with the **Solar Router for ESPHome** project. +!!! tips "Extended capabilities with Home Assistant sensors" + + **Solar Router for ESPHome** is nativelly compatible with some well known power meter of the market (See Power Meter chapter in the left menu). The ***power meter [Home Assistant](power_meter_home_assistant.md)***, extends the source of measurement the any sensors of Home Assistant making it compatible with a huge number of power meters. + ![SolarRouterClosed](images/SolarRouterClosed.png){width=350} ![Dashboard](images/SolarRouterInHomeAssistantDashboard.png){width=350} diff --git a/docs/installation.md b/docs/installation.md index 851313f..52b012e 100644 --- a/docs/installation.md +++ b/docs/installation.md @@ -21,19 +21,21 @@ A **proxy** just need 1 **power meter** package #### Step 2.1: Select a Power Meter -* [Fronius](fronius.md) +* [Fronius](power_meter_fronius.md) Get power data from Fronius inverter (Tested on Gen24 Primo) -* [Proxy client](proxy_client.md) +* [Proxy client](power_meter_proxy_client.md) Get power data from outside from solar router + !!! abstract "Contribute" You are developer and your power meter is missing fron this list, refer to [contributing](contributing.md) section to see how to contribute to this project. #### Step 2.2: Select a Regulator -* [Triac](triac.md) +* [Triac](regulator_triac.md) Regulate energy with a Triac -* [Relay](relay.md) - Regulate energy with a Solid State Relais or a Triac +* [Relay](regulator_relay.md) + Regulate energy with a Solid State Relais or a Triac + !!! abstract "Contribute" You are developer and your regulator is missing fron this list, refer to [contributing](contributing.md) section to see how to contribute to this project. diff --git a/docs/fronius.md b/docs/power_meter_fronius.md similarity index 91% rename from docs/fronius.md rename to docs/power_meter_fronius.md index a2b8677..19c7127 100644 --- a/docs/fronius.md +++ b/docs/power_meter_fronius.md @@ -41,4 +41,7 @@ See [proxy example](proxy_example.md) to see how to implement it. http_request: esp8266_disable_ssl_support: True ``` - See [HTTP Request component](https://esphome.io/components/http_request.html#esp8266-disable-ssl-support) for details \ No newline at end of file + See [HTTP Request component](https://esphome.io/components/http_request.html#esp8266-disable-ssl-support) for details + +!!! warning "Network dependency" + This power meter require the network to gather information about energy exchanged with the grid. \ No newline at end of file diff --git a/docs/power_meter_home_assistant.md b/docs/power_meter_home_assistant.md new file mode 100644 index 0000000..b267cf9 --- /dev/null +++ b/docs/power_meter_home_assistant.md @@ -0,0 +1,25 @@ +# Fronius Home Assistant + +This power meter is designed get power consumption directly from Home Assistant sensor. + +To use this package, add the following lines to your configuration file: + +```yaml linenums="1" +packages: + power_meter: + url: http://github.com/XavierBerger/ESPHome-Solar-Router/ + file: solar_router/power_meter_home_assistant.yaml +``` + +This package needs to know the sensor to use to get the power consumption. This sensor has to be defined by `main_power_sensor` into `subtsitution` section of your configuration as in example ballow: + +```yaml linenums="1" +substitutions: + # Power meter source ----------------------------------------------------------- + # Sensor in home assistant gathering the power consumption + main_power_sensor: sensor.main_power +``` +!!! warning Data availability and refresh rate + This power meter rely on Home Assistant to gather the value of energy exchanged with the grid. It also depends on the rate of sensor update. If a sensor is updated too slowly, the regulation may not work as expected. + + Contrary to Home Assistant power meter, native power meters are autonomous and can continue to regulate even is Home Assistant is offline. Some power meter can have a direct access to the measure and may even be independent to the network. \ No newline at end of file diff --git a/docs/proxy_client.md b/docs/power_meter_proxy_client.md similarity index 79% rename from docs/proxy_client.md rename to docs/power_meter_proxy_client.md index cb0a3e2..caaa745 100644 --- a/docs/proxy_client.md +++ b/docs/power_meter_proxy_client.md @@ -20,13 +20,7 @@ substitutions: power_meter_ip_address: "192.168.1.21" ``` -This integration is activated/deactivated with a global variable `power_meter_activated`. This `globals` is provided by the [solar router engine](engine.md) package. If this power meter is use inside a proxy, it is required to add this `globals` into you configuration yaml as follow: +This integration is activated/deactivated with a global variable `power_meter_activated`. This `globals` is provided by the [solar router engine](engine.md) package. -```yaml linenums="1" -globals: - - id: power_meter_activated - type: int - initial_value: "1" -``` - -See [proxy example](proxy_example.md) to see how to implement it. \ No newline at end of file +!!! warning "Network dependency" + This power meter require the network to gather information about energy exchanged with the grid. \ No newline at end of file diff --git a/docs/proxy_example.md b/docs/proxy_example.md index a52ef85..bdc7b26 100644 --- a/docs/proxy_example.md +++ b/docs/proxy_example.md @@ -1,12 +1,12 @@ # Solar Router using a proxy -The configuration of the **Proxy client** is only using a [Fronuis power meter](fronius.md) +The configuration of the **Proxy client** is only using a [Home Assistant power meter](power_meter_home_assistant.md) ```yaml linenums="1" --8<-- "esp8285-power-meter-proxy.yaml" ``` -This configuration the **Solar Router** is using [Proxy client power meter](proxy_client.md), [Triac regulator](triac.md) and [Solar router engine](engine.md). +This configuration the **Solar Router** is using [Proxy client power meter](power_meter_proxy_client.md), [Triac regulator](regulator_triac.md) and [Solar router engine](engine.md). GPIO pins have been defined to match hardware configuration described [here](hardware.md) diff --git a/docs/relay.md b/docs/regulator_relay.md similarity index 100% rename from docs/relay.md rename to docs/regulator_relay.md diff --git a/docs/triac.md b/docs/regulator_triac.md similarity index 100% rename from docs/triac.md rename to docs/regulator_triac.md diff --git a/docs/solar_router.md b/docs/solar_router.md index 50fc5fe..36bf34f 100644 --- a/docs/solar_router.md +++ b/docs/solar_router.md @@ -1,6 +1,6 @@ # Solar router -**Solar Router for [ESPHome](http://esphome.io)** has been designed to work with [Home Assistant](http://home-assistant.io) and it requires the installation of [ESPHome integration](https://www.home-assistant.io/integrations/esphome/). +**Solar Router for [ESPHome](http://esphome.io)** has been designed to work with [Home Assistant](http://home-assistant.io) and it requires the installation of [ESPHome integration](https://www.home-assistant.io/integrations/esphome/). ![HA](images/SolarRouterInHomeAssistant.png){ align=left } !!! note "" diff --git a/docs/standalone_example.md b/docs/standalone_example.md index e5a0353..748fcfd 100644 --- a/docs/standalone_example.md +++ b/docs/standalone_example.md @@ -1,6 +1,6 @@ # Standalone Solar Router -This configuration of the **Solar Router** is using [Fronuis power meter](fronius.md), [Triac regulator](triac.md), [Solar router engine](engine.md). +This configuration of the **Solar Router** is using [Fronuis power meter](power_meter_fronius.md), [Triac regulator](regulator_triac.md), [Solar router engine](engine.md). GPIO pins have been defined to match hardware configuration described [here](hardware.md) diff --git a/esp8285-power-meter-proxy.yaml b/esp8285-power-meter-proxy.yaml index b4feb9e..03d66f8 100644 --- a/esp8285-power-meter-proxy.yaml +++ b/esp8285-power-meter-proxy.yaml @@ -37,13 +37,14 @@ wifi: substitutions: # Power meter source ----------------------------------------------------------- - # Define ip address of Fronius inverter - power_meter_ip_address: "192.168.1.21" + # Sensor in home assistant gathering the power consumption + main_power_sensor: sensor.solarnet_puissance_du_reseau_electrique # 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 @@ -53,14 +54,10 @@ globals: # packages: # power_meter: # url: https://github.com/XavierBerger/Solar-Router-for-ESPHome/ -# file: solar_router/power_meter_fronius.yaml +# file: solar_router/power_meter_home_assistant.yaml # refresh: 5s - # Remove the following lines if you want to use the source from github packages: power_meter: - <<: !include solar_router/power_meter_fronius.yaml - -http_request: - esp8266_disable_ssl_support: True + <<: !include solar_router/power_meter_home_assistant.yaml diff --git a/mkdocs.yml b/mkdocs.yml index 2df8b0a..494e2ba 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -15,11 +15,12 @@ nav: - Standalone: standalone_example.md - With proxy: proxy_example.md - Power Meter: - - Fronius: fronius.md - - Proxy Client: proxy_client.md + - Fronius: power_meter_fronius.md + - Home Assistant: power_meter_home_assistant.md + - Proxy Client: power_meter_proxy_client.md - Regulator: - - Triac: triac.md - - Relay: relay.md + - Triac: regulator_triac.md + - Relay: regulator_relay.md - Engine: engine.md - Contributing: contributing.md - ChangeLog: changelog.md diff --git a/solar_router/power_meter_home_assistant.yaml b/solar_router/power_meter_home_assistant.yaml new file mode 100644 index 0000000..2383c7a --- /dev/null +++ b/solar_router/power_meter_home_assistant.yaml @@ -0,0 +1,13 @@ +# ---------------------------------------------------------------------------------------------------- +# Define sensor for power collection +# ---------------------------------------------------------------------------------------------------- + +sensor: + # Sensor showing the actual power consumption + - platform: homeassistant + id: real_power + entity_id: ${main_power_sensor} + internal: False + name: "Real Power" + device_class: "power" + unit_of_measurement: "W"