- Platform information:
- Hardware: Raspberry pi 3B+
- OS: Raspbian 10
- Java Runtime Environment: openjdk 11.0.6
- openHAB version: 2.5.9 Release
- Issue of the topic:
I’m just trying to put some item value into the log file.
My Item is the instant power consumption of an electrical outlet
The item is showing ok in the sitemap - Please post configurations (if applicable):
- Items configuration related to the issue
Number LeFeu_Power “Consommation instantanée du feu [%i kWh]” (testGroup) {channel=“tplinksmarthome:hs110:F4A130:power” }
- Sitemap configuration related to the issue
THIS IS WORKING OK, I can see the consumption in basic UI :
sitemap Charneux label=“Maison Charneux” {
Frame {
Text label=“Pellets” icon=“fire” {
Switch item=LeFeu_Alimentation label=“Le feu” icon=“light”
Text item=LeFeu_Power label=“Consommation actuelle [%.1f W]” icon=“energy”
}
}
}
- Rules code related to the issue
THIS RULE IS NOT WORKING :
var boolean isHighConso
// init variables
rule “pellets_autoOff_startup”
when
System started
then
logWarn(“pellets”, “TEST STARTUP LOG DEBUG”)
isHighConso = false
end
rule “pellets_autoOff_cron”
when
Time cron “0 * * * * ?”
then
logWarn(“pellets”, “TEST LOG DEBUG BEGIN - 1”)
logWarn(“pellets”, LeFeu_Power)
logWarn(“pellets”, “TEST LOG DEBUG END”)
end
- Services configuration related to the issue
?? - If logs where generated please post these here using code fences:
2020-10-11 12:35:35.199 [WARN ] [lipse.smarthome.model.script.pellets] - TEST STARTUP LOG DEBUG
2020-10-11 12:36:00.009 [WARN ] [lipse.smarthome.model.script.pellets] - TEST LOG DEBUG BEGIN - 1
2020-10-11 12:36:00.016 [ERROR] [ntime.internal.engine.ExecuteRuleJob] - Error during the execution of rule ‘pellets_autoOff_cron’: An error occurred during the script execution: Could not invoke method: org.eclipse.smarthome.model.script.actions.LogAction.logWarn(java.lang.String,java.lang.String,java.lang.Object) on instance: null