Skip to content

Commit a98caae

Browse files
authored
feat: Add engine dimmer with bypass
BREAKING CHANGE Engine names have been reviewed as in list below: - engine.yaml => engine_1dimmer.yaml - engine_on_off.yaml => engine_1switch.yaml
2 parents 2f7e418 + 0830f23 commit a98caae

35 files changed

+497
-229
lines changed

.github/workflows/esphome_compilation.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,9 @@ jobs:
3131
echo "hotspot_password: \"myHotspotPassword\"" >> secrets.yaml
3232
echo "proxy_api_encryption_key: \"8q4u9dNBGMcsPemx+Q+WzLTU+mLXHAgPsrTpGjyV1hs=\"" >> secrets.yaml
3333
34-
- name: Compile esp32-proxy-client.yaml
34+
- name: Compile esp8266-proxy-client.yaml
3535
continue-on-error: true
36-
run: tools/convert_to_local_source_for_ci.sh esp32-proxy-client.yaml && esphome compile work_in_progress.yaml
36+
run: tools/convert_to_local_source_for_ci.sh esp8266-proxy-client.yaml && esphome compile work_in_progress.yaml
3737
id: conf1
3838

3939
- name: Compile wt32-eth01-solar-water-heater.yaml

docs/en/compile_coverage.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
* common.yaml
55
* power_meter_fronius.yaml
66
* regulator_triac.yaml
7-
* engine.yaml
7+
* engine_1dimmer.yaml
88
* energy_counter_theorical.yaml
99
* temperature_limiter_DS18B20.yaml
1010

@@ -13,11 +13,11 @@
1313

1414
## esp8266-standalone_on_off
1515
* power_meter_home_assistant.yaml
16-
* engine_on_off.yaml
16+
* engine_1switch.yaml
1717
* regulator_mecanical_relay.yaml
1818
* temperature_limiter_home_assistant.yaml
1919

20-
## esp32-proxy-client
20+
## esp8266-proxy-client
2121
* power_meter_proxy_client.yaml
22-
* engine.yaml
22+
* engine_1dimmer_1bypass.yaml
2323
* regulator_solid_state_relay.yaml

docs/en/engine.md

Lines changed: 9 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,15 @@
1+
# Solar router engines
12

2-
# Progressive Engine
3+
An engine is designed to define how many and when energy has to be diverted.
34

4-
This package is implementing the engine of the solar router which determines when and how many energy has to be diverted to the load.
5+
Different kind of engine exists whach can progressively divert energy to a load and manage an ON/OFF switch. See details into engine's dedicated pages.
56

6-
**Progressive engine** calls every second the power meter to get the actual energy exchanged with the grid. If energy produce is greater than energy consummed and exceed the define echange target, the engine will determine the **percentage of the regulator "opening"** and adjusts it dynamically to reach the target.
7+
!!! note "Engine naming"
8+
The name of engine is reflecting how energy divertion is performed:
9+
**Example** : `engine_1dimmer_1bypass` will manage 1 dimmer managing a progressive regulation associated with a bypass relay.
710

8-
Engine's automatic regulation can be activated or deactivated with the activation switch.
911

10-
## User feedback LEDS
12+
### User feedback LEDS
1113

1214
The yellow LED is reflecting the network connection:
1315

@@ -16,37 +18,13 @@ The yellow LED is reflecting the network connection:
1618
- ***blink*** : solar router is not connected to the network and is trying to reconnect.
1719
- ***fast blink*** : An error occurs during the reading of energy exchanged with the grid.
1820

19-
2021
The green LED is reflecting the actual configuration of regulation:
2122

2223
- ***OFF*** : automatic regulation is deactivated.
2324
- ***ON*** : automatic regulation is active and is not diverting energy to the load.
2425
- ***blink*** : solar router is currently sending energy to the load.
2526

26-
## Router Level vs Regulator Opening
27-
28-
The solar router uses two distinct but related level controls:
29-
30-
- **Router Level**: This is the main system-wide control (0-100%) that represents the overall routing state. It controls the LED indicators and energy counter logic. When automatic regulation is enabled, this level is dynamically adjusted based on power measurements.
31-
32-
- **Regulator Opening**: This represents the actual opening level (0-100%) of the physical regulator. By default, it mirrors the router level since there is only one regulator. While it can be controlled independently, changes to regulator_opening alone won't affect the router_level or trigger LED state changes.
33-
34-
The regulator opening entity is hidden from Home Assistant by default. To expose it, add this to your substitutions:
35-
36-
Note: It's recommended to adjust the router_level rather than regulator_opening directly, as this ensures proper system feedback through LEDs and energy monitoring.
37-
38-
## Configuration
39-
40-
To use this package, add the following lines to your configuration file:
41-
42-
```yaml linenums="1"
43-
packages:
44-
engine:
45-
url: https://github.com/XavierBerger/Solar-Router-for-ESPHome/
46-
file: solar_router/engine.yaml
47-
```
48-
49-
When this package is used it is required to define the following paramater is `substitution` section as show in the example bellow:
27+
The configuration of LED are performed on `substitution` section as show in the example bellow:
5028

5129
```yaml linenums="1"
5230
substitutions:
@@ -55,6 +33,4 @@ substitutions:
5533
# Yellow LED is reflecting power meter status
5634
green_led_pin: GPIO19
5735
yellow_led_pin: GPIO18
58-
# (Optional) Expose regulator opening to HA (hidden by default)
59-
hide_regulators: "False"
60-
```
36+
```

docs/en/engine_1dimmer.md

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
2+
# engine_1dimmer
3+
4+
This package is implementing the engine of the solar router which determines when and how many energy has to be diverted to the load.
5+
6+
**engine_1dimmer** calls every second the power meter to get the actual energy exchanged with the grid. If energy produce is greater than energy consummed and exceed the define echange target, the engine will determine the **percentage of the regulator "opening"** and adjusts it dynamically to reach the target.
7+
8+
Engine's automatic regulation can be activated or deactivated with the activation switch.
9+
10+
## Router Level vs Regulator Opening
11+
12+
The solar router uses two distinct but related level controls:
13+
14+
- **Router Level**: This is the main system-wide control (0-100%) that represents the overall routing state. It controls the LED indicators and energy counter logic. When automatic regulation is enabled, this level is dynamically adjusted based on power measurements.
15+
16+
- **Regulator Opening**: This represents the actual opening level (0-100%) of the physical regulator. By default, it mirrors the router level since there is only one regulator. While it can be controlled independently, changes to regulator_opening alone won't affect the router_level or trigger LED state changes.
17+
18+
The regulator opening entity is hidden from Home Assistant by default. To expose it, add this to your substitutions:
19+
20+
Note: It's recommended to adjust the router_level rather than regulator_opening directly, as this ensures proper system feedback through LEDs and energy monitoring.
21+
22+
## Configuration
23+
24+
To use this package, add the following lines to your configuration file:
25+
26+
```yaml linenums="1"
27+
packages:
28+
engine:
29+
url: https://github.com/XavierBerger/Solar-Router-for-ESPHome/
30+
file: solar_router/engine_1dimmer.yaml
31+
```
32+

docs/en/engine_1dimmer_1bypass.md

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
# engine_1dimmer_1bypass
2+
3+
This package implements the engine of the solar router which determines when and how much energy has to be diverted to the load, with a bypass function for maximum efficiency.
4+
5+
When the regulator is intensively used for an extended period, the regulator will tends to overheat. This engine is designed to avoid this issue by activating a bypass relay and turning off the regulator when the regulator is opened at 100% for an extended period. To avoid flickering, the bypass relay is activated only when the regulator is opened at 100% for a number of consecutive regulation.
6+
7+
**engine_1dimmer_1bypass** calls every second the power meter to get the actual energy exchanged with the grid. If energy produced is greater than energy consumed and exceeds the defined exchange target, the engine will determine the **percentage of regulator opening** and adjusts it dynamically to reach the target. When the regulator reaches 100% for an extended period, the bypass relay is activated for maximum efficiency.
8+
9+
Engine's automatic regulation can be activated or deactivated with the activation switch.
10+
11+
## How to wire the bypass relay
12+
13+
- Live on the Bypass Relay Common (COM) and on the Relay to the Live Input of the Regulator
14+
- Normally Closed (NC) floating
15+
- Normally Open (NO) of the Relay to the Load Output of the Regulator (or directly to the Load)
16+
17+
!!! Danger "Follow the wiring instructions"
18+
Do not plug the Regulator Live Input to the Normally Closed (NC) of the relay ! Your load would be de-energized while switching the relay, potentially creating arcs inside the relay.
19+
More info in this [discussion](https://github.com/XavierBerger/Solar-Router-for-ESPHome/pull/51#issuecomment-2625724543).
20+
21+
## Router Level vs Regulator Opening
22+
23+
The solar router uses three distinct but related level controls:
24+
25+
- **Router Level**: This is the main system-wide control (0-100%) that represents the overall routing state. It controls the LED indicators and energy counter logic. When automatic regulation is enabled, this level is dynamically adjusted based on power measurements.
26+
27+
- **Regulator Opening**: This represents the actual opening level (0-100%) of the physical regulator. By default, it mirrors the router level since there is only one regulator. While it can be controlled independently, changes to regulator_opening alone won't affect the router_level or trigger LED state changes.
28+
29+
- **Bypass Relay**: This represents the actual state (ON/OFF) of the physical bypass relay. When the Regulation is enabled, this relay automatically turns on after the duration `Bypass tempo` defined in Home Assistant. When the Regulation is disabled, you can manually trigger this relay to fully energized your load, LEDs and Energy Counter (if enabled) will not be triggered. You can also set the *Router Level* to 100, this will enable the relay, fully energized your load, trigger LEDs and Energy Counter.
30+
31+
## Configuration
32+
33+
To use this package, add the following lines to your configuration file:
34+
35+
```yaml linenums="1"
36+
packages:
37+
engine_regulator_1bypass:
38+
url: https://github.com/XavierBerger/Solar-Router-for-ESPHome/
39+
file: solar_router/engine_regulator_1bypass.yaml
40+
```
41+
42+
!!! tip "Adjusting Bypass Tempo"
43+
The `Bypass Tempo` determines how many consecutive regulations at 100% are needed before activating the bypass relay. A lower value will make the bypass more reactive but might cause more frequent switching (flickering). Because there's roughly 1 regulation per second, `Bypass Tempo` can be approximated as the time in second with the regulator at 100% before which the the bypass relay is activated.

docs/en/engine_on_off.md renamed to docs/en/engine_1switch.md

Lines changed: 5 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11

2-
# ON/OFF Engine
2+
# engine_1switch
33

44
This package is implementing the engine of the solar router which determines energy can be diverted to a local load or not.
55

6-
**ON/OFF engine** calls every second the power meter to get the actual power consumed. If energy sent to the grid is greater than the divertion start level (in W) during start tempo (in s), the relay is closed to use the energy locally. When the energy sent to the grid reach the level (in W) defined to stop the divertion during stop tempo (in s), the relay is openned and local consomption is stopped.
6+
**engine_1switch** calls every second the power meter to get the actual power consumed. If energy sent to the grid is greater than the divertion start level (in W) during start tempo (in s), the relay is closed to use the energy locally. When the energy sent to the grid reach the level (in W) defined to stop the divertion during stop tempo (in s), the relay is openned and local consomption is stopped.
77

8-
ON/OFF engine's automatic regulation can be activated or deactivated with the activation switch.
8+
engine_1switch's automatic regulation can be activated or deactivated with the activation switch.
99

1010
The following schema is representing the consumption with this engine activated:
1111

12-
![engine_on_off](images/engine_on_off.png)
12+
![engine_1switch](images/engine_1switch.png)
1313

1414
**Legend:**
1515

@@ -28,22 +28,6 @@ The following schema is representing the consumption with this engine activated:
2828
!!! tips "finely adjust start and stop tempo"
2929
The start and stop tempo determine the responsiveness of the regulation. These delays must be finely adjusted to avoid oscillations. For example, if you have an electric stove, pay attention to the heating delays.
3030

31-
## User feedback LEDS
32-
33-
The yellow LED is reflecting the network connection:
34-
35-
- ***OFF*** : solar router is not connected to power supply.
36-
- ***ON*** : solar router is connected to the network.
37-
- ***blink*** : solar router is not connected to the network and is trying to reconnect.
38-
- ***fast blink*** : An error occurs during the reading of energy exchanged with the grid.
39-
40-
41-
The green LED is reflecting the actual configuration of regulation:
42-
43-
- ***OFF*** : automatic regulation is deactivated.
44-
- ***ON*** : automatic regulation is active and is not diverting energy to the load.
45-
- ***blink*** : solar router is currently sending energy to the load.
46-
4731
## Configuration
4832

4933
To use this package, add the following lines to your configuration file:
@@ -52,7 +36,7 @@ To use this package, add the following lines to your configuration file:
5236
packages:
5337
engine:
5438
url: https://github.com/XavierBerger/Solar-Router-for-ESPHome/
55-
file: solar_router/engine_on_off.yaml
39+
file: solar_router/engine_1switch.yaml
5640
```
5741
5842
When this package is used it is required to define the following paramater is `substitution` section as show in the example bellow:

docs/en/example_proxy.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,10 @@ The configuration of the **Proxy client** is only using a [Home Assistant power
66
--8<-- "esp8285-power-meter-proxy.yaml"
77
```
88

9-
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).
9+
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_1dimmer.md).
1010

1111
GPIO pins have been defined to match hardware configuration described [here](hardware.md)
1212

1313
```yaml linenums="1"
14-
--8<-- "esp32-proxy-client.yaml"
14+
--8<-- "esp8266-proxy-client.yaml"
1515
```

docs/en/example_standalone.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Standalone Solar Router
22

3-
This configuration implements a **Solar Router** with a progressive regulation. It uses [Fronuis power meter](power_meter_fronius.md), [Triac regulator](regulator_triac.md), [Progressive engine](engine.md).
3+
This configuration implements a **Solar Router** with a progressive regulation. It uses [Fronuis power meter](power_meter_fronius.md), [Triac regulator](regulator_triac.md), [Progressive engine](engine_1dimmer.md).
44

55
GPIO pins have been defined to match hardware configuration described [here](hardware.md)
66

docs/en/hardware.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,5 +45,5 @@ Bill of material:
4545
* 1 x ESP8266 (or equivalent)
4646

4747
!!! Note "This router has some limitation"
48-
* It has to be used with ON/OFF regulation (engine_on_off.yaml) and is not compatible with variable engine
48+
* It has to be used with ON/OFF regulation (engine_1switch.yaml) and is not compatible with variable engine
4949
* Due to the small space of memory, it doesn't support OTA update

docs/en/installation.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,10 +51,10 @@ A **proxy** just need 1 **power meter** package
5151

5252
#### Step 2.3: Add an Engine
5353

54-
* [Progressive Engine](engine.md)
54+
* [Progressive Engine](engine_1dimmer.md)
5555
Read power exchange with the grid, determine and apply the percentage of router level.
5656

57-
* [ON/OFF Engine](engine_on_off.md)
57+
* [ON/OFF Engine](engine_1switch.md)
5858
Read power exchange with the grid, and start to divert energy if a threshold is reached and stop if another threshold is reached.
5959

6060
#### Step 2.4: Add an Energy Counter (*Optional*)

docs/en/regulator_mecanical_relay.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,22 +12,22 @@ The following schematic is representing the wiring of the relay:
1212

1313
!!! Warning "Be carefull during wiring and use the Normally Open (NO) pin."
1414

15-
!!! Danger "WARNING : This kind of relay is not compatible with progressive engine. Only use it [engine ON/OFF](engine_on_off.md)"
15+
!!! Danger "WARNING : This kind of relay is not compatible with progressive engine. Only use it [engine ON/OFF](engine_1switch.md)"
1616

1717
To use this package, add the following lines to your configuration file:
1818

1919
```yaml linenums="1"
2020
packages:
21-
regulator:
21+
relay_regulator:
2222
url: https://github.com/XavierBerger/Solar-Router-for-ESPHome/
2323
file: solar_router/regulator_mecanical_relay.yaml
2424
```
2525
26-
This package require the definition of pin connected to the gate of the relay : `regulator_gate_pin`
26+
This package require the definition of pin connected to the gate of the relay : `relay_regulator_gate_pin`
2727

2828
```yaml linenums="1"
2929
substitutions:
3030
# Regulator configuration ------------------------------------------------------
3131
# Define GPIO pin connected to the relay gate.
32-
regulator_gate_pin: GPIO22
32+
relay_regulator_gate_pin: GPIO22
3333
```

docs/fr/contributing.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ Vous souhaitez contribuer ? Vous êtes les bienvenus et vous trouverez ci-dessou
77

88
Vous pouvez proposer n'importe quel matériel selon vos besoins. Si ce nouveau matériel nécessite l'utilisation de GPIO, les broches utilisées par votre matériel doivent être configurées dans la section `substitution`.
99

10-
Une documentation doit être ajoutée décrivant ce nouveau matériel et ses contraintes (Ex : capacités GPIO). Voir le chapitre [mettre à jour la documentation](#mettre-à-jour-la-documentation) ci-dessous.
10+
Une documentation doit être ajoutée décrivant ce nouveau matériel et ses contraintes (Ex : capacités GPIO). Voir le chapitre [mettre à jour la documentation](#mettre-a-jour-la-documentation) ci-dessous.
1111

1212
## Développer un **Package Logiciel**
1313

@@ -55,7 +55,7 @@ Ce capteur est utilisé par les **Moteurs** pour obtenir la valeur de la puissan
5555

5656
Si ce nouveau compteur de puissance nécessite une configuration spécifique, les paramètres requis doivent être ajoutés dans la section `substitution`.
5757

58-
Une documentation doit être ajoutée décrivant le compteur de puissance et comment le configurer. Voir le chapitre [mettre à jour la documentation](#mettre-à-jour-la-documentation) ci-dessous.
58+
Une documentation doit être ajoutée décrivant le compteur de puissance et comment le configurer. Voir le chapitre [mettre à jour la documentation](#mettre-a-jour-la-documentation) ci-dessous.
5959

6060
### Développer des **Regulators**
6161

@@ -86,7 +86,7 @@ Vous pouvez développer un ou plusieurs régulateurs pour travailler ensemble da
8686

8787
Si ce nouveau compteur de puissance nécessite une configuration spécifique, les paramètres requis doivent être ajoutés dans la section `substitution`.
8888

89-
Une documentation doit être ajoutée décrivant le compteur de puissance et comment le configurer. Voir le chapitre [mettre à jour la documentation](#mettre-à-jour-la-documentation) ci-dessous.
89+
Une documentation doit être ajoutée décrivant le compteur de puissance et comment le configurer. Voir le chapitre [mettre à jour la documentation](#mettre-a-jour-la-documentation) ci-dessous.
9090

9191
## Mettre à jour la **Documentation**
9292

0 commit comments

Comments
 (0)