A few months ago I created the Simple PID Controller, a PID control which can be fully configured from the UI!
It’s downloadable from HACS, more information here: GitHub - bvweerd/simple_pid_controller: PID Controller integration for Home Assistant
A few months ago I created the Simple PID Controller, a PID control which can be fully configured from the UI!
It’s downloadable from HACS, more information here: GitHub - bvweerd/simple_pid_controller: PID Controller integration for Home Assistant
Hello, all PID controllers I could find for HA were not working, I ended up doing one in automation. Cool you did it, I will surely test it. Purpose is EV charger and inverter control not to blow my circuit braker, not for temperature. Thanks for this!
Good to hear! It’s definitely meant as a generic PID controller, not for temperatures specifically. Hope it works for you!
Doing a PID is easy, having it like it seems (not tested yet) is another thing. I will keep you posted. David. Where are you from?
Hello, Is your PID controller now working correctly for your car charger ?
Yes it is.
It is a drama not to find one that works
Hi, first of all I want to thank you very much for this PID controller. I have only used it for one room in the zone control of my house but it is working perfectly so far. I have one request. If it would be possible to adjust the setpoint to one tenth place? Now I can only enter the whole number 21 or 22, it would be great if I could enter 21.5

Good catch, small type in the code. fixed in v1.5.1, will be available shortly
Hi,
thank you for your great work.
I urgently need a PID Controller, but I don’t understand how this integration works, where I have to put which information to get it up and running.
I need support.
This is my use case:
While loading my solar battery in my house I am not allowed to exceed 17kW power import from the grid.
Since I have a lot of loads switching on an off all the time, I cannot work with a static value for the charging current of my battery and could use a PID controller and set it to setpoint 16 (kW) to provide a charging power close to my limit of 17 kW, but hopefully not exceeding it.
My entity for the power import in kW from the grid is “sensor.power_import”.
That entity can vary theoretically from -10 to 30 but the negative numbers are irrelevant during the time period I am charging the battery.
During that phase the entity varies between 5-20 but I do not want to exceed 17.
I want to control the charging current of my solar battery “number.max_battery_grid_charge_current”.
The value range of that entity is 0 - 30.
How do I have to set this up?
If you could explain this to me I would be very thankful.
First, install the Simple PID Controller in Home Assistant:
When setting up the integration, enter:
Battery Grid Charge Controllersensor.power_import-10 (your sensor’s minimum)30 (your sensor’s maximum)0 (minimum charging current)30 (maximum charging current)After setup, go to Settings > Devices & Services → Find your new controller → Click Configure or adjust the entities:
Critical Settings:
16 (kW - your target grid import)-2.0 (negative for inverse control)-0.2 (negative for inverse control)-0.5 (negative for inverse control)5 seconds (fast response for load changes)0 A30 AONON (prevents integral windup)This is an inverse control problem:
Using negative Kp, Ki, and Kd inverts the controller action to achieve this behavior.
The PID controller creates a sensor (e.g., sensor.battery_grid_charge_controller_pid_output) that outputs the calculated charging current. You need an automation to apply this to your battery:
automation:
- alias: "Apply PID Battery Charging Control"
trigger:
- platform: state
entity_id: sensor.battery_grid_charge_controller_pid_output
action:
- service: number.set_value
target:
entity_id: number.max_battery_grid_charge_current
data:
value: "{{ states('sensor.battery_grid_charge_controller_pid_output') | float }}"
Go to Settings > Devices & Services → Your controller → Enable these sensors:
PID P ContributionPID I ContributionPID D ContributionErrorThese help you monitor how the controller responds to your loads.
Start with the suggested values and observe:
28 A instead of 30 A to leave a safety marginWith this setup:
Absolutely awesome!
Thank you so much.
I will implement that later today, but with these detailed informations it will work for sure.
My main problem was, that I didn’t know how to set the target.
Now, with the automation, it’s crystal clear.
Thank you ![]()