That*s the normal way to access the home_presence item.
But actually I want access the item only by the name, so without the SwitchItem.
Then I want to figure out the item type (Switch, Dimmer, Roolershutter…) and
act with the item correctly.
So something like:
Ok,
again (nearly same situation in the past ) it looks my Ide (pyCharm) to cause that Problems.
Even with the correct import for Openhabitem it will not run, and marks the call to openhabitem with a red underline.
This will return a local HABApp Item (e.g. for sharing states between rule files or intermediate values).
It’s basivally a HABApp internal variable but with the benefit that you can trigger on it and it issues events.
This will send a query to openhab and return the response.
It’s almost always the one you should not use.
This is the correct one. It’s almost always the one you should use.
It returns the item from the HABApp item registry so there is no communication going on between HABApp and openHAB when you do this.
If you want to check if it’s a DimmerItem but you got it with OpenhabItem.get_item you can do:
now i changed my rules all from self.openhab.get_item to OpenhabItem.get_item but then i see something strange:
it seems that all items in openhab that have no channel assigned (i call it virtual items) are not reported to habapp as long as they are not changed after a system reboot, even when they are persisted and have correct value in openhab.
that openhabitem returns the item from the habapp registry.
But for my understanding, when is this transfered from openhab to the habapp item registry?
Is the copy to the habapp registry already done in the rule function?