Platform information:
Hardware: Raspberry PI 4
OS: Raspbian
Java Runtime Environment: which java platform is used and what version
openHAB version: 2.5
When changing a switch from the sitemap the item receives the command, but when using a rule to do the same the change is not triggered all the way.
Items:
String MQTT_varasto_fan “MQTT Varasto tuuletin [%s]” { channel=“mqtt:topic:mosquitto:MQTT_Storage_temperature::MQTT_storage_fan” }
Sitemap:
Switch item=MQTT_varasto_fan label=“Varaston tuuletin [%S]” valuecolor=[ON=“red”,OFF=“black”]
Rules:
logInfo(“Sami”,“Storage temperature updated - checking if FAN needs to be on”)
if((MQ_Varasto_temp > Varasto_temp_upper) && (MQ_Varasto_temp > MQ_Ulkoilma_temp))
{
MQTT_varasto_fan.sendCommand(ON)
logInfo (“Sami”,“Storage fan has received ON command”)
}
Rule based log:
12:32:06.991 [INFO ] [smarthome.event.ItemCommandEvent ] - Item ‘Varasto_temp_sp’ received command 20
12:32:07.012 [INFO ] [smarthome.event.ItemStateChangedEvent] - Varasto_temp_sp changed from 19 to 20
12:32:07.018 [INFO ] [g.eclipse.smarthome.model.script.Sami] - Storage FAN rule evaluation started
12:32:07.026 [INFO ] [g.eclipse.smarthome.model.script.Sami] - Storage temperature updated - checking if FAN needs to be on
12:32:07.035 [INFO ] [g.eclipse.smarthome.model.script.Sami] - Storage fan has received ON command
12:32:07.035 [INFO ] [smarthome.event.ItemCommandEvent ] - Item ‘MQTT_varasto_fan’ received command ON
Sitemap triggered log:
12:32:12.480 [INFO ] [smarthome.event.ItemCommandEvent ] - Item ‘MQTT_varasto_fan’ received command ON
12:32:12.494 [INFO ] [arthome.event.ItemStatePredictedEvent] - MQTT_varasto_fan predicted to become ON
12:32:12.504 [INFO ] [smarthome.event.ItemStateChangedEvent] - MQTT_varasto_fan changed from OFF to ON