I want to regulate the power consumption of my 2000W electric boiler, using the Shelly Dimmer 0/1-10V PM, and a proportional 0-10V SSR.
Is it easy in HA to set the output voltage of the dimmer, perhaps someone can post some examples ?
What I want to do is, via the Homewizard P1 meter, read how much power my solar panels inject into the electricity network, and set the power consumption of the boiler, so that it only works when I inject power to the grid.
So when I inject 300 W into the grid, the boiler should only consume 300W, and when the solar panels inject more than 2000 W, the boiler can work at its full 2000 power.
The power consumption of the boiler needs to be proportional to the grid injection, in order to always work on solar power, instead of taking power from the grid.
I have similar DIY setup, triac based voltage regulator and Esphome controlling heating element based on the excess measured by Shelly EM.
I like your idea of using 0-10V SSR though. I suggest you to get quality SSR, not the $5 one from AE. Also be aware that in 0-10V control one of the devices has to source current. So you should at least have a datasheet for the SSR.
I’m not 100% sure, but I believe gen3 shelly is sourcing type while previous gen2 was sinking type.
Thanks for your suggestion about sourcing/sinking, I thought that the Shelly dimmer by default provided the control voltage for the ssr.
The SSR I looked at is a type that is used to drive industrial CNC machine motors, it is specified for 40A, and above 10A it needs additional cooling.
It does not provide a 10V source, so I need to check if the Shelly dimmer is providing the voltage source to drive the SSR.
The Shelly dimmer arrived, I used the HA built in integration to connect to it, but HA only provides an on-off switch entity, nothing to control the dimmer voltage.
I looked in the HA shelly integration docs, but I don’t see a solution there either, apart from some cryptic sentence
Shelly device relays are added to Home Assistant by default as switch entities.
A relay can be added as a light entity if EXTERNAL CONSUMPTION TYPE
value is set to light.
Any ideas on how to control the dimmer brightness ?
In the mean time, thanks to Chatgpt, I found out how to control the dimmer, and together with a 0-10V controllable SSR, I now have a working solution that makes my boiler work completely on solar produced energy.
I made a request to make the HA docs more clear on that point, but it was refused, the devs told me that everything was covered well in the docs as they are now, and they were not willing to add any clarification or an example on how to control the dimmer.
Here is the solution I created to control the dimmer
It is a combination of a template to calculate the brightness_pct value, and an automation to write that value into the dimmer.
template:
- sensor:
- name: "tp_pct"
unit_of_measurement: "%"
state: >-
{% set LoadNominalPower = 2000 %}
{% set NomPowerPCT = LoadNominalPower / 50 %}
{% set Offset = 500 %}
{% set raw_value = ((states('sensor.shelly0110dimg3_8cbfeaa72794_light_0_power') | float(0))
+ Offset + (states('sensor.p1_meter_active_power') | float(0)) * -1) / NomPowerPCT %}
{{ raw_value | round(0) | int if 1 <= raw_value <= 100 else 1 if raw_value < 1 else 100 }}
and the automation
alias: adjust Shelly dimmer according to solar production
description: ""
triggers:
- entity_id: sun.sun
from: above_horizon
to: below_horizon
trigger: state
- entity_id: sensor.tp_pct
trigger: state
actions:
- choose:
- conditions:
- condition: state
entity_id: sun.sun
state: above_horizon
sequence:
- target:
entity_id: light.shelly0110dimg3_8cbfeaa72794_light_0
data:
brightness_pct: "{{ states('sensor.tp_pct') | int(0) }}"
action: light.turn_on
- delay:
hours: 0
minutes: 0
seconds: 0
milliseconds: 500
- conditions:
- condition: state
entity_id: sun.sun
state: below_horizon
sequence:
- target:
entity_id: light.shelly0110dimg3_8cbfeaa72794_light_0
data:
brightness_pct: 0
action: light.turn_on
- delay: "00:00:10"
- target:
entity_id: light.shelly0110dimg3_8cbfeaa72794_light_0
action: light.turn_off
data: {}
mode: single
you can specify brightness in percent (a number between 0 and 100), where 0 means the light is off, 1 is the minimum brightness and 100 is the maximum brightness supported by the light.
for my warm water boiler heating optimization Works pretty well with an automation to ramp up / down depending on PV yield / battery state. In addition I control the heating such that I feed my 4kW into the grid (am not allowed to feed in more) and use the excess PV energy for the heating.
The only thing I would like to tune → If you use ‘increase / decrease brightness’ from the integration it switches 10% +/- → would love to have that halved to 5% +/- but that is (to the best of my knowledge) not configurable in the Shelly. I am now trying to read the brightness value (already solved this) and then increasing it ‘manually’ by setting brightness directly in the automation instead of the ‘increase / decrease brightness function’ . However this is a bit fidley In reality wou won’t need that if you are not an opitmization nerd as I am