22.10.2020, 07:28
Hello
I'm a total newbie on scripting, but i'm trying to learn, so please bear with me
I want to add more than one PID termostats. Can i put more than one PID in one Resident skript?
The case is:
I have 2 bedrooms with one temp sensor, and one heater controlled by a KNX in each room. The heaters should only be controllable by visualization.
This is the code for one heater, and it works great, but where can i put in the code for the second heater?
I have tried to put it in on the bottom of the code, and inside before p:run()
Only the first one works. The codes are identical for both heaters (except group adresses)
Thanks!
I'm a total newbie on scripting, but i'm trying to learn, so please bear with me
I want to add more than one PID termostats. Can i put more than one PID in one Resident skript?
The case is:
I have 2 bedrooms with one temp sensor, and one heater controlled by a KNX in each room. The heaters should only be controllable by visualization.
This is the code for one heater, and it works great, but where can i put in the code for the second heater?
Code:
-- init pid algorithm
-- Panelovn Mikkel
if not p then
p = PID:init({
current = '2/2/0',
setpoint = '2/2/7',
output = '2/2/6'
})
end
-- run algorithm
p:run()
I have tried to put it in on the bottom of the code, and inside before p:run()
Only the first one works. The codes are identical for both heaters (except group adresses)
Thanks!