1) Give a description of the problem
Need to simplify a repetitious piston
2) What is the expected behaviour?
To be smaller - I’ve kludged this together generally lacking knowedge
3) What is happening/not happening?
It’s massive!
4) Post a Green Snapshot of the piston
5) Attach logs after turning logging level to Full
No logs, but this should keep it easier to get my point across… This is one piston that’s used for a single room’s temperature schedule, pretty much a basic, ugly list of what temperature I’d like to set the room to for the whole day.
Process is as follows:
- This script runs once per minute.
- DS18b20 probe reads the room temp (device roomtempsensor)
- Piston checks what temp it should be between 2pm & 3pm by checking the hourly variable (integer 1400_1500)
- If it’s too cold, sends command to my radiator TRV (device radiator) to open
- This fires up the central heating via a zwave boiler switch.
There’s loads of (horrible!) background ugly code and various other pistons so I can set the maximum temperature (ever), do a 30 min temp boost, disable the heating when the alarm is set, etc.
Anyhoo, my issue (as mentioned) is the size of the code. I was hoping someone might be able to suggest a way of turning this…
…etc (as you can imagine, there’s 24 sections). I did use variables as much as possible when I first horribly knocked together, knowing that when I’d sorted one room then I could duplicate the piston for the other rooms, just altering the RADIATOR and TEMP PROBE devices to the right ones for that particular room, and obviously adjust the hourly temp settings.
Again, totally aware it looks horrific, there are doubtlessly better ways of doing this (I’d love a decent UI/smartapp, but that’s down the line when I learn more). I just really needed to get something up and running at the time which was within my scope/skills.
Could anyone please assist? I’d love to get these pistons knocked down from 22 sections or whatever they are now!
Cheers !
REMOVE BELOW AFTER READING
If a solution is found for your question then please mark the post as the solution.