Skip to content

Commit 3d0697f

Browse files
authored
feat: Add engines managing 3 resistors water heater and optionally a bypass relay
2 parents a1d6cda + 82137db commit 3d0697f

18 files changed

+1037
-5
lines changed

docs/en/engine_1dimmer.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ packages:
3838
```
3939
4040
When this package is used it is required to define `green_led_pin` and `yellow_led_pin` in `vars` section as show in the upper example.
41+
4142
* `xxx_led_inverted` can define is led is active on high or low signal and is optional.
4243
* `hide_regulators` allow to hide or show regulators sensors from HA and is optionnal.
4344
* `hide_leds` allow to hide or show leds values from HA and is optionnal.

docs/en/engine_1dimmer_1bypass.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ packages:
4848
```
4949
5050
When this package is used it is required to define `green_led_pin` and `yellow_led_pin` in `vars` section as show in the upper example.
51+
5152
* `xxx_led_inverted` can define is led is active on high or low signal and is optional.
5253
* `hide_regulators` allow to hide or show regulators sensors from HA and is optionnal.
5354
* `hide_leds` allow to hide or show leds values from HA and is optionnal.
Lines changed: 99 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,99 @@
1+
# Engine 1 x dimmer + 2 x switches
2+
3+
This package implements the engine of the solar router which determines when and how much energy has to be diverted to three loads using three channels, or a single load with three channels like a water heater with three heating resistors.
4+
5+
The engine uses two relays to control different loads, with an additional regulator for fine-grained power control. The loads are activated sequentially as more power becomes available:
6+
7+
1. First channel: Relay 1 (On/Off control)
8+
2. Second channel: Relay 2 (On/Off control)
9+
3. Third channel: Dimmer regulator (Variable power control)
10+
11+
When power needs increase:
12+
13+
- First, the regulator on channel 3 gradually increases power
14+
- When regulator reaches 33.33%, relay 1 activates
15+
- When regulator reaches 66.66%, relay 2 activates
16+
17+
**Engine 1 x dimmer + 2 x switches** 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 appropriate combination of relays and regulator opening to reach the target.
18+
19+
Engine's automatic regulation can be activated or deactivated with the activation switch.
20+
21+
## How to wire the relay (Channel 1 & 2)
22+
23+
- Line on the Relay Common (COM)
24+
- Normally Open (NO) of the Relay from the input Load directly to the Load
25+
26+
## How to wire the dimmer regulator (Channel 3)
27+
28+
- Just like any other dimmer from the input Load directly to the Load, and without any connection to other relay or channel 1 & 2.
29+
30+
## Wiring schema example
31+
32+
![Wiring schema example for water heater](images/3ResistorsWaterHeaterExample.svg)
33+
34+
## Configuration
35+
36+
To use this package, add the following lines to your configuration file:
37+
38+
```yaml linenums="1"
39+
packages:
40+
engine:
41+
url: https://github.com/XavierBerger/Solar-Router-for-ESPHome/
42+
files:
43+
- path: solar_router/engine_1dimmer_2switches.yaml
44+
vars:
45+
green_led_pin: GPIO1
46+
green_led_inverted: 'False'
47+
yellow_led_pin: GPIO2
48+
yellow_led_inverted: 'False'
49+
hide_regulators: 'True'
50+
hide_leds: 'True'
51+
```
52+
When this package is used it is required to define `green_led_pin` and `yellow_led_pin` in `vars` section as show in the upper example.
53+
54+
* `xxx_led_inverted` can define is led is active on high or low signal and is optional.
55+
* `hide_regulators` allow to hide or show regulators sensors from HA and is optionnal.
56+
* `hide_leds` allow to hide or show leds values from HA and is optionnal.
57+
58+
!!! note "Power Distribution"
59+
The engine divides the total available power into three equal portions (33.33% each). This allows for smooth transitions between different power levels and efficient distribution of excess solar power across multiple loads.
60+
61+
!!! tip "Bypass tempo adjustement"
62+
The Bypass Tempo determines how many consecutive regulations at 33.33% or 66.66% 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 33.33% or 66.66% before which relay are activated.
63+
64+
65+
![HA](images/countdown_engine_1dimmer_2switch.png){ align=left }
66+
!!! note ""
67+
**Sensors**
68+
69+
* ***Countdown for relay no. X***
70+
For each relay, the current countdown is displayed.
71+
Initially the countdown is equal to the tempo bypass value, then with each energy regulation where the controller is at 100% the countdown is reduced, finally when the countdown is equal to zero the relay is activated.
72+
* ***Regulator opening***
73+
Hidden by default (see `hide_regulators`), displays the regulator level (TRIAC or SSR).
74+
75+
76+
This package requires the use of the Regulator Relay package AND a regulator package (TRIAC or SSR). Do not forget to also include them.
77+
78+
You can find below the example of configuration for relays:
79+
80+
```yaml linenums="1"
81+
packages:
82+
relay1_regulator:
83+
url: https://github.com/XavierBerger/Solar-Router-for-ESPHome/
84+
files:
85+
- path: solar_router/regulator_mecanical_relay.yaml
86+
vars:
87+
relay_regulator_gate_pin: GPIO17
88+
relay_unique_id: "1"
89+
relay2_regulator:
90+
url: https://github.com/XavierBerger/Solar-Router-for-ESPHome/
91+
files:
92+
- path: solar_router/regulator_mecanical_relay.yaml
93+
vars:
94+
relay_regulator_gate_pin: GPIO18
95+
relay_unique_id: "2"
96+
```
97+
98+
!!! note "Relay Ids"
99+
Relay unique ids can't be change to use this engine.
Lines changed: 111 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,111 @@
1+
# Engine 1 x dimmer + 2 x switches + 1 x bypass
2+
3+
This package implements the engine of the solar router which determines when and how much energy has to be diverted to three loads using three channels, or a single load with three channels like a water heater with three heating resistors, with the third channel having bypass functionality for maximum efficiency.
4+
5+
The engine uses three relays to control different loads, with an additional regulator for fine-grained power control. The loads are activated sequentially as more power becomes available:
6+
7+
1. First channel: Relay 1 (On/Off control)
8+
2. Second channel: Relay 2 (On/Off control)
9+
3. Third channel: Relay 3 AND dimmer regulator (Variable power control)
10+
11+
When power needs increase:
12+
13+
- First, the regulator on channel 3 gradually increases power
14+
- When regulator reaches 33.33%, relay 1 activates
15+
- When regulator reaches 66.66%, relay 2 activates
16+
- When regulator reaches 100%, relay 3 activates and bypasses the regulator
17+
18+
**Engine 1 x dimmer + 2 x switches + 1 x bypass** 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 appropriate combination of relays and regulator opening to reach the target.
19+
20+
Engine's automatic regulation can be activated or deactivated with the activation switch.
21+
22+
## How to wire the relay (Channel 1 & 2)
23+
24+
- Line on the Relay Common (COM)
25+
- Normally Open (NO) of the Relay from the input Load directly to the Load
26+
27+
## How to wire the regulator and the bypass relay (Channel 3)
28+
29+
- Live on the Bypass Relay Common (COM) and on the Relay to the Live Input of the Regulator
30+
- Normally Closed (NC) floating
31+
- Normally Open (NO) of the Relay to the Load Output of the Regulator (or directly to the Load)
32+
33+
!!! Danger "Follow the wiring instructions"
34+
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.
35+
More info in this [discussion](https://github.com/XavierBerger/Solar-Router-for-ESPHome/pull/51#issuecomment-2625724543).
36+
37+
## Wiring schema example
38+
39+
![Wiring schema example for water heater](images/3ResistorsWaterHeaterExampleWithBypass.svg)
40+
41+
## Configuration
42+
43+
To use this package, add the following lines to your configuration file:
44+
45+
```yaml linenums="1"
46+
packages:
47+
engine:
48+
url: https://github.com/XavierBerger/Solar-Router-for-ESPHome/
49+
files:
50+
- path: solar_router/engine_1dimmer_2switches_1bypass.yaml
51+
vars:
52+
green_led_pin: GPIO1
53+
green_led_inverted: 'False'
54+
yellow_led_pin: GPIO2
55+
yellow_led_inverted: 'False'
56+
hide_regulators: 'True'
57+
hide_leds: 'True'
58+
```
59+
When this package is used it is required to define `green_led_pin` and `yellow_led_pin` in `vars` section as show in the upper example.
60+
61+
* `xxx_led_inverted` can define is led is active on high or low signal and is optional.
62+
* `hide_regulators` allow to hide or show regulators sensors from HA and is optionnal.
63+
* `hide_leds` allow to hide or show leds values from HA and is optionnal.
64+
65+
!!! note "Power Distribution"
66+
The engine divides the total available power into three equal portions (33.33% each). This allows for smooth transitions between different power levels and efficient distribution of excess solar power across multiple loads.
67+
68+
!!! tip "Bypass tempo adjustement"
69+
The Bypass Tempo determines how many consecutive regulations at 33.33%, 66.66% or 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 33.33%, 66.66% or 100% before which relay are activated.
70+
71+
![HA](images/countdown_engine_1dimmer_2switch_1bypass.png){ align=left }
72+
!!! note ""
73+
**Sensors**
74+
75+
* ***Countdown for relay no. X***
76+
For each relay, the current countdown is displayed.
77+
Initially the countdown is equal to the tempo bypass value, then with each energy regulation where the controller is at 100% the countdown is reduced, finally when the countdown is equal to zero the relay is activated.
78+
* ***Regulator opening***
79+
Hidden by default (see `hide_regulators`), displays the regulator level (TRIAC or SSR).
80+
81+
This package requires the use of the Regulator Relay package AND a regulator package (TRIAC or SSR). Do not forget to also include them.
82+
83+
You can find below the example of configuration for relays:
84+
85+
```yaml linenums="1"
86+
packages:
87+
relay1_regulator:
88+
url: https://github.com/XavierBerger/Solar-Router-for-ESPHome/
89+
files:
90+
- path: solar_router/regulator_mecanical_relay.yaml
91+
vars:
92+
relay_regulator_gate_pin: GPIO17
93+
relay_unique_id: "1"
94+
relay2_regulator:
95+
url: https://github.com/XavierBerger/Solar-Router-for-ESPHome/
96+
files:
97+
- path: solar_router/regulator_mecanical_relay.yaml
98+
vars:
99+
relay_regulator_gate_pin: GPIO18
100+
relay_unique_id: "2"
101+
relay3_bypass_regulator:
102+
url: https://github.com/XavierBerger/Solar-Router-for-ESPHome/
103+
files:
104+
- path: solar_router/regulator_mecanical_relay.yaml
105+
vars:
106+
relay_regulator_gate_pin: GPIO21
107+
relay_unique_id: "3"
108+
```
109+
110+
!!! note "Relay Ids"
111+
Relay unique ids can't be change to use this engine, especially the `relay_unique_id: "3"` is always used for the bypass relay.

docs/en/engine_1switch.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ packages:
4848
```
4949
5050
When this package is used it is required to define `green_led_pin` and `yellow_led_pin` in `vars` section as show in the upper example.
51+
5152
* `xxx_led_inverted` can define is led is active on high or low signal and is optional.
5253
* `hide_regulators` allow to hide or show regulators sensors from HA and is optionnal.
5354
* `hide_leds` allow to hide or show leds values from HA and is optionnal.

docs/fr/engine_1dimmer.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ packages:
2626
```
2727
2828
Il est necessaire de définir `green_led_pin` et `yellow_led_pin` dans la section `vars` comme montré dans l'exemple ci-dessus.
29+
2930
* Le paramètre `xxx_led_inverted` permet de définir si la LED est active sur niveau haut ou bas. Ce paramètre est optionnel.
3031
* Le paramètre `hide_regulators` permet de définir si le capteur de régulateur est affiché dans HA. Ce paramètre est optionnel.
3132
* Le paramètre `hide_leds` permet de définir si les valeurs des leds sont affichées dans HA. Ce paramètre est optionnel.

docs/fr/engine_1dimmer_1bypass.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ packages:
4848
hide_leds: 'True'
4949
```
5050
Il est necessaire de définir `green_led_pin` et `yellow_led_pin` dans la section `vars` comme montré dans l'exemple ci-dessus.
51+
5152
* Le paramètre `xxx_led_inverted` permet de définir si la LED est active sur niveau haut ou bas. Ce paramètre est optionnel.
5253
* Le paramètre `hide_regulators` permet de définir si le capteur de régulateur est affiché dans HA. Ce paramètre est optionnel.
5354
* Le paramètre `hide_leds` permet de définir si les valeurs des leds sont affichées dans HA. Ce paramètre est optionnel.
Lines changed: 97 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,97 @@
1+
# Engine 1 x dimmer + 2 x switches
2+
3+
Ce package implémente le moteur du routeur solaire qui détermine quand et quelle quantité d'énergie doit être déviée vers trois charges utilisant trois canaux, ou une seule charge avec trois canaux comme un chauffe-eau avec trois résistances de chauffage.
4+
5+
Le moteur utilise 2 relais pour contrôler les différentes charges et d'un régulateur supplémentaire pour un contrôle fin de la puissance. Les charges sont activées de manière séquentielle au fur et à mesure que la puissance devient disponible :
6+
1. 1er canal : Relay 1 (On/Off)
7+
2. 2ème canal: Relay 2 (On/Off)
8+
3. 3ème canal: Un gradateur TRIAC ou SSR (Contrôl variable)
9+
10+
Lorsque les besoins en énergie augmentent :
11+
12+
- Tout d'abord, le régulateur du canal 3 augmente progressivement la puissance.
13+
- Lorsque le régulateur atteint 33,33 %, le relais 1 s'active
14+
- Lorsque le régulateur atteint 66,66 %, le relais 2 s'active
15+
16+
**Le moteur 1 x variateur + 2 x interrupteurs** appelle toutes les secondes le compteur électrique pour obtenir l'énergie réelle échangée avec le réseau. Si l'énergie produite est supérieure à l'énergie consommée et dépasse l'objectif d'échange défini, le moteur déterminera la combinaison appropriée de relais et d'ouverture du régulateur pour atteindre l'objectif.
17+
18+
La régulation automatique du moteur peut être activée ou désactivée à l'aide de du switch d'activation.
19+
20+
## Comment câbler les relais (canaux 1 et 2)
21+
22+
- Ligne sur le relais Commun (COM)
23+
- Normalement ouvert (NO) du relais de la charge d'entrée directement à la charge
24+
25+
## Comment câbler le gradateur (Canal 3)
26+
27+
Comme n'importe quel autre gradateur, l'entrée de la charge est directement reliée à la charge, sans connexion à d'autres relais ou canaux 1 et 2.
28+
29+
## Schema d'exemple de cablage
30+
31+
![Wiring schema example for water heater](images/3ResistorsWaterHeaterExample.svg)
32+
33+
## Configuration
34+
35+
Pour utiliser ce package, ajoutez les lignes suivantes à votre fichier de configuration :
36+
37+
```yaml linenums="1"
38+
packages:
39+
engine:
40+
url: https://github.com/XavierBerger/Solar-Router-for-ESPHome/
41+
files:
42+
- path: solar_router/engine_1dimmer_2switches.yaml
43+
vars:
44+
green_led_pin: GPIO1
45+
green_led_inverted: 'False'
46+
yellow_led_pin: GPIO2
47+
yellow_led_inverted: 'False'
48+
hide_regulators: 'True'
49+
hide_leds: 'True'
50+
```
51+
Il est necessaire de définir `green_led_pin` et `yellow_led_pin` dans la section `vars` comme montré dans l'exemple ci-dessus.
52+
53+
* Le paramètre `xxx_led_inverted` permet de définir si la LED est active sur niveau haut ou bas. Ce paramètre est optionnel.
54+
* Le paramètre `hide_regulators` permet de définir si le capteur de régulateur est affiché dans HA. Ce paramètre est optionnel.
55+
* Le paramètre `hide_leds` permet de définir si les valeurs des leds sont affichées dans HA. Ce paramètre est optionnel.
56+
57+
!!! note "Distribution de la puissance"
58+
Le moteur divise la puissance totale disponible en trois parties égales (33,33 % chacune). Cela permet des transitions en douceur entre les différents niveaux de puissance et une distribution efficace de l'énergie solaire excédentaire sur plusieurs charges.
59+
60+
!!! tip "Ajustement du Bypass tempo"
61+
Le `Bypass tempo` détermine combien de régulations consécutives à 33.33% ou 66.66% sont nécessaires avant d'activer le relais de bypass. Une valeur plus basse rendra le bypass plus réactif mais pourrait causer des commutations plus fréquentes (scintillement). Comme il y a environ 1 régulation par seconde, `Bypass tempo` peut être approximé comme le temps en secondes avec le régulateur à 33.33% ou 66.66% avant que le relais de bypass ne soit activé.
62+
63+
64+
![HA](images/countdown_engine_1dimmer_2switch.png){ align=left }
65+
!!! note ""
66+
**Capteurs**
67+
68+
* ***Compte à rebours du relai n° X***
69+
Pour chaque relai on affiche le compte à rebours en cours.
70+
Au départ le compte à rebours est égale à la valeur du bypass tempo, puis à chaque régulation d'énergie où le régulateur est à 100% on diminue le compte à rebours, enfin lorsque le compte à rebours est égale à zéro on active le relai.
71+
* ***Ouverture du régulateur***
72+
Caché par défaut (voir `hide_regulators`), permet d'affiché le niveau du régulateur (TRIAC ou SSR).
73+
74+
Ce paquet nécessite l'utilisation du package Relais régulateur ET d'un package régulateur (TRIAC ou SSR). N'oubliez pas de les inclure également.
75+
76+
Vous trouverez ci-dessous l'exemple de configuration pour les relais :
77+
78+
```yaml linenums="1"
79+
packages:
80+
relay1_regulator:
81+
url: https://github.com/XavierBerger/Solar-Router-for-ESPHome/
82+
files:
83+
- path: solar_router/regulator_mecanical_relay.yaml
84+
vars:
85+
relay_regulator_gate_pin: GPIO17
86+
relay_unique_id: "1"
87+
relay2_regulator:
88+
url: https://github.com/XavierBerger/Solar-Router-for-ESPHome/
89+
files:
90+
- path: solar_router/regulator_mecanical_relay.yaml
91+
vars:
92+
relay_regulator_gate_pin: GPIO18
93+
relay_unique_id: "2"
94+
```
95+
96+
!!! note "Relay Ids"
97+
Les identifiants uniques des relais ne peuvent pas être modifiés pour utiliser ce moteur.

0 commit comments

Comments
 (0)