Platform information:
- Hardware: raspberry PI 4 / 32GiB
- OS: Raspbian GNU/Linux 10 (buster)
- Java Runtime Environment: docker openhab/openhab:3.0.0
- openHAB version: openhab/openhab:3.0.0
Issue:
After upgrading to openhab 3.0.0, I noticed that one of my rules was not taking effect. After further investigation, I realized that it’s due to openhab not getting an ItemStateChangedEvent when I turned the light on/off from the light switch on the wall. The rule basically takes the level of the dimmer and copies it to another dimmer. I verified that the rule is operating correctly by setting the level of the Office_Main dimmer from the item page in the GUI, and seeing that the change is reflected in the mirrored device Office_SmartPlug_Dimmer.
If I instead configure the item using the GUI (after removing it from zwave.items), everything behaves as expected (I see ItemStateChangedEvent, and the rule takes effect when operated from the wall switch or the GUI item page).
How would I debug this further, or if not, how would I achieve the same configuration using an items file as from the GUI? Is file-based configuration still suggested / supported?
Please post configurations (if applicable):
Items configuration related to the issue
zwave.items:
Dimmer Office_SmartPlug_Dimmer "Office Lamp" (Light, Sitter) ["Point"] {zwave="zwave:device:3680e6d4:node4:switch_multilevel", ga="Light"}
Dimmer Office_Main "Office" (Light, Sitter) ["Point"] {zwave="zwave:device:3680e6d4:node34:switch_multilevel", ga="Light"}
Rules code related to the issue
Office Link 2:
triggers:
- id: "1"
configuration:
itemName: Office_Main
type: core.ItemStateUpdateTrigger
conditions: []
actions:
- inputs: {}
id: "2"
configuration:
blockSource: <xml xmlns="https://developers.google.com/blockly/xml"><block
type="oh_event" id="P4h?tVQ/nU=M+yVNJ(Sn" inline="false" x="186"
y="146"><field name="eventType">sendCommand</field><value
name="value"><shadow type="text" id="b~}HuBynqAX(;SM9qr]F"><field
name="TEXT">value</field></shadow><block type="oh_getitem_state"
id="C[kX~EYfhgTycwK|G+}N"><value name="itemName"><shadow type="oh_item"
id="(t,,7u?Z#l8,hjF_NOxo"><field
name="itemName">Office_Main</field></shadow></value></block></value><value
name="itemName"><shadow type="oh_item" id="]w$kBlx(!$St93G4$3_O"><field
name="itemName">Office_SmartPlug_Dimmer</field></shadow></value></block></xml>
type: application/javascript
script: >
events.sendCommand('Office_SmartPlug_Dimmer', itemRegistry.getItem('Office_Main').getState());
type: script.ScriptAction
Item / metdata from console:
Using Items File:
openhab> openhab:items list Office_Main
Office_Main (Type=DimmerItem, State=NULL, Label=Office, Category=null, Tags=[Point], Groups=[Light, Sitter])
openhab> openhab:metadata list Office_Main
Metadata [key=semantics:Office_Main, value=Point, configuration=[]]
Metadata [key=zwave:Office_Main, value=zwave:device:3680e6d4:node34:switch_multilevel, configuration=[]]
Metadata [key=ga:Office_Main, value=Light, configuration=[]]
Using GUI configuration:
openhab> openhab:items list Office_Main
Office_Main (Type=DimmerItem, State=100, Label=Office, Category=DimmableLight, Tags=[Point], Groups=[Light, Sitter])
openhab> openhab:metadata list Office_Main
Metadata [key=semantics:Office_Main, value=Point, configuration=[hasLocation=Office]]
Metadata [key=ga:Office_Main, value=Light, configuration=[roomHint=Office]]
Logs:
When things are working properly, there are no events emitted when I hit the light switch on the wall. When I define the item using the GUI, however, I see the expected:
11:44:11.218 [INFO ] [openhab.event.ItemUpdatedEvent ] - Item 'Office_Main' has been updated.
11:44:44.969 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'Office_Main' changed from NULL to 0
11:44:45.003 [INFO ] [openhab.event.ItemCommandEvent ] - Item 'Office_SmartPlug_Dimmer' received command 0
11:44:45.022 [INFO ] [openhab.event.ItemStatePredictedEvent] - Item 'Office_SmartPlug_Dimmer' predicted to become 0
11:44:45.037 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'Office_SmartPlug_Dimmer' changed from 100 to 0
11:44:47.331 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'Office_Main' changed from 0 to 100
11:44:47.348 [INFO ] [openhab.event.ItemCommandEvent ] - Item 'Office_SmartPlug_Dimmer' received command 100
11:44:47.362 [INFO ] [openhab.event.ItemStatePredictedEvent] - Item 'Office_SmartPlug_Dimmer' predicted to become 100
11:44:47.374 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'Office_SmartPlug_Dimmer' changed from 0 to 100