Problems with wait statement


#1

Hi, I designed a piston which should issue a carbon dioxide warning (source is a Netatmo sensor) to my Lametric display and my Sonos speaker every hour, if the CO2 concentration is above a certain level:

Basically the piston works, but the warning is issued every 10 minutes and not every 60 minutes as it should. Did I overlook something or designed it in a wrong way?

I’m grateful for any advice.


#2

see if it’s a glitch of some sort. change “1 hour” to "60 minutes"
then report back if it works or not.


#3

Try changing the execution mode to ASYNC


#4

If your sensor reports every 10 minutes then that’s the correct behavior. Change the condition to a trigger “rises above 1500” - this wille ensure it only runs once (and then repeat). Move the wait inside the previous action. You also need a while to make it stop:

if co2 raises over 1500
   while co2 is greater than 1400 (tcp = never)
      with location do
         ...
         wait 1 hour;
      end with;
   end while;
end if;