Skip to content

Commit

Permalink
updates
Browse files Browse the repository at this point in the history
  • Loading branch information
mathieucarbou committed Jul 9, 2024
1 parent 0a7c254 commit e7d6151
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 5 deletions.
16 changes: 13 additions & 3 deletions docs/blog/2024-07-01_shelly_solar_diverter.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ All the components can be bought at [https://www.shelly.com/](https://www.shelly

| [Shelly Pro EM - 50](https://www.shelly.com/fr/products/shop/proem-1x50a) | [Shelly Dimmer 0/1-10V PM Gen3](https://www.shelly.com/fr/products/shop/1xsd10pmgen3) | [Shelly Plus Add-On](https://www.shelly.com/fr/products/shop/shelly-plus-add-on) | [Temperature Sensor DS18B20](https://www.shelly.com/fr/products/shop/temperature-sensor-ds18B20) | Voltage Regulator<br>- [Loncont LSA-H3P50YB](https://fr.aliexpress.com/item/32606780994.html)<br>- [LCTC DTY-220V40P1](https://fr.aliexpress.com/item/1005005008018888.html) |
| :-----------------------------------------------------------------------: | :-----------------------------------------------------------------------------------: | :------------------------------------------------------------------------------: | :----------------------------------------------------------------------------------------------: | :--------------------------------------------------------------------------------------------------------------------------------------------------------------------------: |
| ![](../assets/img/hardware/Shelly_Pro_EM_50.jpeg) | ![](../assets/img/hardware/Shelly_Dimmer-10V.jpeg) | ![](../assets/img/hardware/Shelly_Addon.jpeg) | ![](../assets/img/hardware/Shelly_DS18.jpeg) | ![](../assets/img/hardware/LSA-H3P50YB.jpeg)<br>![](../assets/img/hardware/LCTC_Voltage_Regulator_DTY-220V40P1.jpeg) |
| ![](../assets/img/hardware/Shelly_Pro_EM_50.jpeg) | ![](../assets/img/hardware/Shelly_Dimmer-10V.jpeg) | ![](../assets/img/hardware/Shelly_Addon.jpeg) | ![](../assets/img/hardware/Shelly_DS18.jpeg) | ![](../assets/img/hardware/LSA-H3P50YB.jpeg)<br>![](../assets/img/hardware/LCTC_Voltage_Regulator_DTY-220V40P1.jpeg) |

Some additional hardware are required depending on the installation.
**Please select the amperage according to your needs.**
Expand Down Expand Up @@ -129,9 +129,10 @@ Also, this central place allows to control the 1, 2 or more dimmers remotely.

- Set static IP address
- Make sure to place the A clamp around the main phase entering the house in the right direction
- Add the `Shelly Solar Diverter` to the Shelly Pro EM
- Add the `Shelly Solar Diverter` script to the Shelly Pro EM
- Configure the settings in the `CONFIG` object
- Start the script
- Activate `Run on startup`

## How to use

Expand Down Expand Up @@ -184,7 +185,7 @@ const CONFIG = {
// The remaining percentage will be given to the next dimmers
RESERVED_EXCESS_PERCENT: 100,
// Set whether the Shelly EM with this script will be used to control the bypass relay to force a heating
// When set to true, if you activate remotely the bypass to force a heating, then the script will tur the dimmer off
// When set to true, if you activate remotely the bypass to force a heating, then the script will detect it and turn the dimmer off
BYPASS_CONTROLLED_BY_EM: true,
},
"192.168.125.97": {
Expand Down Expand Up @@ -314,6 +315,15 @@ http://192.168.125.92/script/1/status
}
```

### Automation ideas

- Stop the automatic divert when the temperature of the water tank reaches a specific value, and turn it back on when the temperature goes below a specific value.
- Schedule a force heating of the water tank based on days and hours
- Either by turning on the bypass relay controlled by the Shelly EM
- Or by disabling the auto-divert script, and then turning the dimmer on and set it to 100%

**Sadly, the Shelly App is very limited** in terms of actions so you might need to use Home Assistant or Jeedom depending on what you ned to do.

### PID Control and Tuning

The script uses a complex PID controller that can be tuned to really obtain a very good routing precision.
Expand Down
4 changes: 2 additions & 2 deletions docs/downloads/auto_diverter_v1.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ const CONFIG = {
// The remaining percentage will be given to the next dimmers
RESERVED_EXCESS_PERCENT: 100,
// Set whether the Shelly EM with this script will be used to control the bypass relay to force a heating
// When set to true, if you activate remotely the bypass to force a heating, then the script will tur the dimmer off
// When set to true, if you activate remotely the bypass to force a heating, then the script will detect it and turn the dimmer off
BYPASS_CONTROLLED_BY_EM: true
},
"192.168.125.97": {
Expand Down Expand Up @@ -274,7 +274,7 @@ function divert(voltage, gridPower) {
let newRoutingPower = calculatePID(gridPower);

if (CONFIG.DEBUG > 0)
print(scriptName, ":", "Grid:", voltage, "V,", gridPower, "W. Power to divert:", newRoutingPower, "W");
print(scriptName, ":", "Grid:", voltage, "V,", gridPower, "W => To divert:", newRoutingPower, "W");

for (let ip in DIVERT.dimmers) {
const dimmer = DIVERT.dimmers[ip];
Expand Down

0 comments on commit e7d6151

Please sign in to comment.