Initialising items on startup

I have set a rule to set default value for two items but when I display it in log only one seems to display correctly , however displaying sitemap it seems both are correct.
is this the best practice for initializing values?

log: output

initialising Hotwater low temp:38.0, very low:NULL


rule "hotwater initialise"
  System started 
  if (HotwaterMins.state == NULL) { HotwaterMins.postUpdate(60)   }
  if (HotwaterLow.state == NULL)  { 
	  logInfo("hotwater", "initialising Hotwater low temp:" + HotwaterLow.state + ", very low:" + HotwaterVeryLow.state )

postUpdate only puts the update onto openHAB’s internal event bus. It gets actioned a little while.later.
That to say, if you issue postUpdate in a rule it does not stop and wait for the update to be carried out.

ok asynchronous update… ok good to know.

1 Like