Hi all,
I'am trying to create a scritp to implement the famous PID thermostat controller for heaters and today I'am encountering 2 different issues:
1/ this kind of script needs to be able to switch On/Off on a timing smaller than a minute.
For example if the calculation define a heating period of 1 minute and 50 seconds, how could I control these 50 seconds ? I could do some rounding to maximise the periods to 30 seconds by saying for example if the timing returned is below 30 seconds then I execute it he minute and if it is after 30 seconds then I execute it the minute after.
But by doing that I am loosing a lot in precision and I would have at least a precision of 15 seconds which could be done by having a script called each 30 seconds instead of each minute of having some kind of Sleep method, then I could loop in my script.
2/ My temperature configuration is currently hardcoded in the script and I have not find any way to control it by the UI directly do you have any idea how I could do that from the UI ?
Thanks
Lua Scripts questions for PID implementation
Moderator: leecollings
Re: Lua Scripts questions for PID implementation
Hi Again,
So I have partially solve my issues at least the Issue 1 by creating a fake device which switch every 15 seconds, so when it switch off I move it back to On and my script is call every 15 seconds. I could have set it to a smaller but it generate thousand of logs, which brings me to a new question:
Is there a way to not log state changes for a specific device ?
And my issue 2 about setting the temperature is still valid if somebody has an idea, then it could be great !
Thanks
So I have partially solve my issues at least the Issue 1 by creating a fake device which switch every 15 seconds, so when it switch off I move it back to On and my script is call every 15 seconds. I could have set it to a smaller but it generate thousand of logs, which brings me to a new question:
Is there a way to not log state changes for a specific device ?
And my issue 2 about setting the temperature is still valid if somebody has an idea, then it could be great !
Thanks
-
- Posts: 133
- Joined: Wednesday 11 March 2015 19:13
- Target OS: Raspberry Pi / ODroid
- Domoticz version: Beta
- Contact:
Re: Lua Scripts questions for PID implementation
does someone has a good workind scrip with PID implementation? (For controlling my heating)
-
- Posts: 673
- Joined: Thursday 02 October 2014 6:36
- Target OS: Raspberry Pi / ODroid
- Domoticz version: 2022.2
- Location: Geleen
- Contact:
Re: Lua Scripts questions for PID implementation
I suppose you used google?
https://www.google.nl/webhp?sourceid=ch ... #q=pid+lua
Propably not going to be easy.
https://www.google.nl/webhp?sourceid=ch ... #q=pid+lua
Propably not going to be easy.
Who is online
Users browsing this forum: No registered users and 1 guest