just wanted to share my experience with smart thermostat. I am using it to control the Raspberry Pi CPU cooling fan: indeed, piin 18 can be used for PWM speed control. Find my configuration below:
Obiouvsly, this is not a speed control, it just turns the fan on and off according to pwm window. So now my questions
Has anyone else used this setup? Any suggestion on better configuration?
How should I consider the parameter pwm? Is that the time window that PID uses to calculate the pulse lenght? E.g. if my pwm is 15 seconds and output is 50%, the fan will be on for 7.5 seconds
Would it be possible to implement a true pwm control (e.g. using pigpio library) for fan speed control?
Would it be possible to expose all the PID parameters for integration into Lovelace?
Thank you for your great job on this smart thermostat!
So my question is, if i could control a heater valve with it, which is controlled with the valve opening from 0% to 100%. I know here are PID sontrollers which output a value from 0 to 100 to open the valve accordingly and not like the PWM style what i read here.
So i mean open the valve by lets say 25% and not open the valve completely for 2,5 minutes in the range of 10 minutes.
Hello.
Itās difficult to be sure, as the pid_dt attribute is setting the scale so I canāt see the levels of p, i and d.
But the heater activation with positive error often means integral is too high or Kd gain is too high Vs the temperature decrease rate.
I donāt recommend to use this thermostat to adjust fan speed of the Raspberry through Home Assistant. If Home Assistant core hangs or its priority becomes low due to heavy resources loading, fan control will be down while processor may heat a lot.
This PWM should be controlled at Linux core system instead, there are python scripts that can be directly executed by the system services controller, Iām using it with satisfaction.
Then I canāt help. I donāt know how HA OS is managing the Pi, but itās Linux based, so there should be systemd services management.
I used this tutorial :
If you can manage your pi with SSH you may be able to add it, but Iām afraid HA OS updates may overwrite and break manually added services.
I personally use Raspbian and run several servers in Docker containers (Home Assistant, ZWaveJS2MQTT, Grafana, Portainer, InfluxDB, MQTTā¦) when there are frequent updates, or directly as services at system level (fan controller, SomfyProtect2MQTT, deConz, NodeJS, TVheadEndā¦). It gives much more flexibility.
Maybe you can try using a script, the script will read the attribute directly (using {{ state_attr('climate.thermostat', 'control_output') }} template) and set the valve directly, and set the script as heater entity.
Really likes this thermostat! Using it with a shelly RGBW-unit to operate 2 actuators(for the moment) and it seems to work very well. My issue is that my actuators is of type NO(normally open) which means that when thermostat is trying to heat, it closes the valve and room will be colder. For now i made i Q&D solution by calling SERVICE_TURN_OFF instead of SERVICE_TURN_ON and also validating that entity is STATE_OFF in function _is_device_active. It seems to work but as i said, this is very dirty. I think that the configuration should have one parameter like invert output=Yes/No or something. If this is already possible, please show me.
Finally, thanks for this awesome work!
IĀ“m testing it and at first i realized some odd behavior since sometimes when actual temperature was one deg below set temp it was idle. Then after looking at the history for the thermostat(very useful!), I realize that the problem was meā¦
IĀ“m using Shelly H&T and to save batteries i configured it to only send when the temperature has changed one degreeā¦ I guess the thermostat is having a hard life regulating in this conditions. Will set the update for a higher resolution tomorrow. I guess this is what you call SISO(Shit In Shit Out). So just make sure you are smarter than me
The PID needs precision for temperature measurement to adapt the modulation whenever temperature changes. So yes you need at least 0.1Ā°C precision on the sensor otherwise the overshoot will be strong and regulation not good at all.
And please note that the themostat might remain idle while measured temperature is below the set point. As the PID considers the error (set point - measured temperature) and temperature variation (increasing or decreasing rate and duration above or below set point), if the temperature is 1Ā°C below the target but increasing, the thermostat may reduce the ON time or switch off completely the heater.
This will depend on the PID gains.
I have read the discussion above, and previously I was also experimenting with my own PID controlled thermostat.
In my setup I want to control the boiler modulation using OpenTherm, not just on/off.
My question is: How to translate the PID output to the boiler temperature ? Simple scale to allowed temperature range (ex. if PID is 50% and the temperature range is 35-55 degrees, then the boiler temperature is 45 degrees ?)
Pyscripter allows you to import RPi.GPIO and I can manipulate the pins reading and writing. I canāt get the PWM to work though, no errors, but also no output.
Does this work for standard heaters also? I have made mine available as on/off switches and want to use external sensors. Or is there something better to use than just generic thermostat?