Hi,
I’m struggling with what I guess are basics with rules…
I have created an item:
Number Temp_Target_Lounge "Lounge Target [%.1f °C]" <temperature>
and rule:
import org.openhab.core.library.types.*
import org.openhab.core.persistence.*
import org.openhab.model.script.actions.*
//======================================================================================
rule "Heating System Started Defaults"
when
System started
then
logInfo( "HTG", "System Start Actions" );
var Number required_temp = 20
logInfo( "HTG", "dbg-01" );
postUpdate( Temp_Target_Lounge, required_temp )
logInfo( "HTG", "dbg-02" );
var msg = "System Started, Temp Defaulted to " + required_temp
logInfo( "HTG", msg );
end
But based on the output in the openhab.log file (in debug mode):
10:20:07.391 [INFO ] [c.internal.ModelRepositoryImpl:98 ] - Refreshing model 'heating.rules'
10:20:07.404 [DEBUG] [m.r.internal.engine.RuleEngine:264 ] - Executing startup rule 'Heating System Started Defaults'
10:20:07.410 [INFO ] [org.openhab.model.script.HTG :53 ] - System Start Actions
so only the first logItem ever appears in the log, and (I guess) the rule stops (presumably with an error). I have also tried just two logItem’s like this:
import org.openhab.core.library.types.*
import org.openhab.core.persistence.*
import org.openhab.model.script.actions.*
//======================================================================================
rule "Heating System Started Defaults"
when
System started
then
logInfo( "HTG", "System Start Actions" );
logInfo( "HTG", "dbg-01" );
end
But again only the first logItem is run.
What am I doing wrong in what seems such a simple test?
Thank you.