- Platform information:
- Hardware: NAS with Intel CPU and 16GB
- OS: OpenHab Container image
- Java Runtime Environment: OpenHab Container image
- openHAB version: 4.1.2
Dear all,
I have a rule which updates an item via senCommand. Afterwards it uses the item to compile a http request. Unfortunately not every time the value is updated on time, as I can see it also in the logs.
The rule:
if (WR_VoltageBulk_timer === null) {
WR_VoltageBulk_timer = createTimer(now.plusSeconds(300)) [|
if (WR1_Bat_Voltage_Number >= Set_Bat_Voltage_Number) {
Set_Bat_Voltage_Number = Set_Bat_Voltage_Number + 0.3
Set_Bat_Spannung.sendCommand(Set_Bat_Voltage_Number)
Set_Bat_Spannung.sendCommand(Set_Bat_Voltage_Number)
logInfo("Rules", "Bat Spannung "+Set_Bat_Spannung.state.format("%.1f").toString)
sendHttpPostRequest("http://192.168.249.44/befehl.steuerung.php?befehl=PCVV"+Set_Bat_Spannung.state.format("%.1f").toString+"&id=1")
sendHttpPostRequest("http://192.168.249.44/befehl.steuerung.php?befehl=PBFT"+Set_Bat_Spannung.state.format("%.1f").toString+"&id=1")
telegramAction.sendTelegram("Batteriespannung automatisch erhöht auf "+Set_Bat_Spannung.state.format("%.1f").toString+"V.")
logInfo("Rules", "Bat Spannung "+Set_Bat_Spannung.state.format("%.1f").toString)
}
WR_VoltageBulk_timer = null
]
}
I write before and after the http requests are send the values to the log files. Sometimes I can oberve the value is not updated. E.g.
2024-05-18 09:34:02.504 [INFO ] [org.openhab.core.model.script.Rules ] - Bat Spannung 51.0
2024-05-18 09:34:02.588 [INFO ] [org.openhab.core.model.script.Rules ] - Bat Spannung 51.3
What can I do, to prevent this?
Thank you!