rayg Posted November 26, 2020 Posted November 26, 2020 (edited) FYI the heater keeps a hole in the ice to allow decomposition gases to exhaust. So a few times a day I want to check the current temperature and run the heater for a variable amount of time. IF ( Time is 5am or Time is 8pm ) -- Cheap hours AND (OpenWeatherMap Temperature <= 0 and > -5.0) -- Celsius Then Set Pond Heater ON, Wait 1 Hour, Set Pond Heater OFF; Unfortunately This program (and the 2 variants I have for running 2 and 3 hours) run more often than 5am and 8pm and often leaves the device ON; What would really like is the equivalent of a CASE statement or the ability to derive and store the Wait time based on the Temperature. CASE Temp between -5 and 0 then Set waitTimeHours = 1 CASE Temp Between -10 and -5.1 then Set waitTimeHours = 2 CASE Temp < -10 THEN Set waitTimeHours = 3 Q1: What are your suggestions for achieving variable Wait times base on Temperature readings? Q2: Is there a way for the Program Name and Step to be added to the Log for viewing? Is logging granularity adjustable? Q3: Is there a way to prevent a program from running if another instance is already running? Sounds like that is a no but asking just in case. Many thanks in advance. ...Ray Edited November 26, 2020 by rayg
rayg Posted November 28, 2020 Author Posted November 28, 2020 I thought for sure I'd get several suggestions.
MrBill Posted November 28, 2020 Posted November 28, 2020 (edited) I started to reply but stopped because I figured someone else would have a better idea..... But I would break it up into several programs the First If time is 5:00 AM or time is 7:00 PM or time is 12:00 AM then Run Temp_Range_1 (if) Program Temp_Range_1 if temp <=0 and temp > -5 then set pond heater on wait 1 hour set pond heater off else run Program Temp_Range_2 Program Temp_Range_2 if temp <=-5 and temp > -10 then set pond heater on wait hour set pon2d heater off else run Program Temp_Range_3 etc........ All programs after the first should be disabled so they don't run on temp alone. Edited November 28, 2020 by MrBill
rayg Posted November 28, 2020 Author Posted November 28, 2020 Thanks I like the idea especially the smart use of the ELSE clause. I am testing it now. As for Disabling the others do I really have to do that? They would never run on a temperature change event would they? Thanks again for the reply. ...Ray
MrBill Posted November 28, 2020 Posted November 28, 2020 1 hour ago, rayg said: As for Disabling the others do I really have to do that? They would never run on a temperature change event would they? I believe that if you don't disable them they will run every time the temp moves. Disabling them will cause them only to run when called by the time program. 1
Recommended Posts