Hello,
I have problems migrating OH2.4 to OH3.4. It would be nice if somebody can support.
During migration to OH 3.4 (from 2.4) I had to update all my Items, to use channels (instead of mqtt). So I added a thing and some channels (working with mqtt), used by Items.
Via MQTT the item changes to ON in OH3.4 ( OH2.4 it was received command ON) .
Triggering via MQTT the updated rules work. There are other sources to trigger the Item , e.g. HABpanel. Triggering via HABpanel generates the following Events :
2023-01-04 22:10:37.249 [INFO ] [openhab.event.ItemCommandEvent ] - Item ‘EG_GZ_T0’ received command ON – ok
2023-01-04 22:10:37.259 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item ‘EG_GZ_T0’ changed from OFF to ON – ok
2023-01-04 22:10:37.274 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item ‘EG_GZ_T0’ changed from ON to OFF – ok
2023-01-04 22:10:37.285 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item ‘EG_GZ_T0’ changed from OFF to ON — !!! why ?
I don’t get it why there is a changed from OFF to ON ?
With OH 2.4 I used a Rule :
rule "LightToggleRxOn"
when
**Item EG_GZ_T0 received command ON**
then
if (EG_GZ_R6.state == ON) {
sendCommand(EG_GZ_R6, OFF) // Relais aus
sendCommand(EG_GZ_T0, OFF) // Taster wieder auf off stellen
}
else
{
if (EG_GZ_R6.state == OFF) { // Relais off
sendCommand(EG_GZ_R6, ON) // switch relais on
}
else {
sendCommand(EG_GZ_R6, ON) // switch relais on
}
}
end
Wit OH3.4 the Item do not receive Command on, so I had to change the Rule to :
rule "LightToggleRxOn"
when
**Item EG_GZ_T0 changed to ON**
then
postUpdate(EG_GZ_T0, OFF) // Reset the Status to Off , but do not trigger the received command Off rule
if (EG_GZ_R6.state == ON) {
sendCommand(EG_GZ_R6, OFF) // Relais aus
sendCommand(EG_GZ_T0, OFF) // Taster wieder auf off stellen
}
else
{
if (EG_GZ_R6.state == OFF) { // Relais off
sendCommand(EG_GZ_R6, ON) // switch relais on
}
else {
sendCommand(EG_GZ_R6, ON) // switch relais on
}
}
end
Thanks in advance !
Christian