Comments (33)
As I understand, you only change the thing label.
Can you please tell us if this is something that does not work only for Shelly things or for any thing ?
And what is your running OH version ?
from openhab-core.
@lolodomo yes, for any binding/thing you do ..it doesn't matter if you only change the label or the settings of the thing....so just a change...also item files I see this behavior....
I recognized this behavior in OH4.2M2
OH4.2M2 on latest openhabian release
from openhab-core.
I am able to reproduce. We can change several times the thing label and it is properly updated. The problem is only when you try to restore the initial value. This change is apparently ignored even if the logs show that the file is reloaded.
from openhab-core.
@jimtng ! do you think your PR #4076 could also fix this issue ? If not, with your knowledge of how the loading of things is working, do you understand the current issue ?
from openhab-core.
I haven't tested this scenario specifically. Without tracing it at runtime, I "suspect" this is what's happening:
- Version 1 was loaded
- .things file changed, Version 2 loaded, but due to the leak, Version 1 is still retained in memory, and Version 2 added to the
thingsMap
. This issue/leak is fixed in #4076. - .things changed back to Version 1, but because it wasn't cleared off
thingsMap
in the previous change, a match is found, and therefore the file isn't reloaded.
#4076 should fix this issue
from openhab-core.
Ok, I will test again once #4076 is merged.
from openhab-core.
#4076 is merged
from openhab-core.
Yes it's merged, but it hasn't yet made it into the latest snapshot. Hopefully within the next 12 hours!
from openhab-core.
Tested with snapshot 4064 including #4076. The problem is now different, it is now possible to restore the initial value. But now the very first change after startup is "ignored". The next ones are OK.
@jimtng : any idea ?
from openhab-core.
Is it possible to update the issue title to precise that it concerns Thing files ?
from openhab-core.
@lolodomo better title now?
from openhab-core.
Tested with snapshot 4064 including #4076. The problem is now different, it is now possible to restore the initial value. But now the very first change after startup is "ignored". The next ones are OK.
I can't seem to reproduce this issue. Can you tell me the steps to reproduce it?
Here's what I did:
- Create a test.things file:
Thing astro:sun:home "test1" [ geolocation="52.5200066,13.4049540,100", interval=60 ]
Thing astro:moon:home "test1" [ geolocation="52.5200066,13.4049540", interval=60 ]
- Stop openhab
- Start openhab
- Run a script to show the label of the
astro:sun:home
- it logged it as "test1" - Modified the test.things file and changed the label to "test2"
- Rerun the script to show the label, it now logged as "test2" so it appears that it did get updated.
from openhab-core.
My scenario was:
- Having a file astro.things file in conf/things containing
Thing astro:sun:local "Astro" @ "Extérieur" [ geolocation="xxxx" ]
- Start OH
- Edit the file by changing the thing label and save & quit the file => I see the log about file loading but when I refresh the page in Main UI showing the list of things, the label is unchanged. Confirmed by running the console command "things list | grep astro".
- Edit the file by changing the thing label and save & quit the file => I see the log about file loading and now when I refresh the page in Main UI showing the list of things, the label is correct. Confirmed by running the console command "things list | grep astro".
Tested on RPI. The file is on the SD card (so not a network share) and edited using vi.
from openhab-core.
My scenario was:
- Having a file astro.things file in conf/things containing
Thing astro:sun:local "Astro" @ "Extérieur" [ geolocation="xxxx" ]
- Start OH
- Edit the file by changing the thing label and save & quit the file => I see the log about file loading but when I refresh the page in Main UI showing the list of things, the label is unchanged. Confirmed by running the console command "things list | grep astro".
- Edit the file by changing the thing label and save & quit the file => I see the log about file loading and now when I refresh the page in Main UI showing the list of things, the label is correct. Confirmed by running the console command "things list | grep astro".
I'm still not able to reproduce the problem.
I tried your things file verbatim (including geolocation="xxxx"
). As a result I got
Astro parameters geolocation could not be split into latitude and longitude, disabling thing 'astro:sun:local'
But upon changing the label, it did get updated on the Main UI (I had to refresh the browser).
I then tried entering an actual coordinate in the .things file:
Thing astro:sun:local "Astro" @ "Extérieur" [ geolocation="52.5200066,13.4049540,100" ]
Stopped openhab
Started it, confirming the label in Main UI
Then this time using vim to edit the file locally (not over samba), then saved the changes with :wq
the new label showed up on main ui.
from openhab-core.
Of course, I do not use "xxxx" as geolocation, it was just to not provide a real position.
If you are sure it works, I will try again.
from openhab-core.
My server was restarted yesterday. This morning, I tried again and I reproduced the problem. The first change of thing label is not applied even if the change of file is detected. Next changes are fine, even returning to the original thing label.
@miloit : can you confirm my experience with #4076 merged ?
from openhab-core.
@lolodomo can confirm same behaviour as before
I am on openHAB 4.2.0 (Build #4065)
I changed the file shelly.things from
Thing shelly:shellyplus1pm:441793cea354 "Plus1PM_Bett_links" @ "Bedroom" [deviceIp="ip", password="password"] Thing shelly:shellyplus1pm:d4d4da7cbde0 "Plus1PM_Bett_rechts" @ "Bedroom" [deviceIp="ip", password="password"]
to
Thing shelly:shellyplus1pm:441793cea354 "Plus1PM_Bett_linkse" @ "Bedroom" [deviceIp="ip", password="password"] Thing shelly:shellyplus1pm:d4d4da7cbde0 "Plus1PM_Bett_rechtse" @ "Bedroom" [deviceIp="ip", password="password"]
in the log I see
2024-05-05 10:57:28.575 [INFO ] [el.core.internal.ModelRepositoryImpl] - Loading model 'shelly.things'
But still the old description in the UI
I stopped openhab started new now it was changed....tried it 2 times the same scenario....means only new loaded with a restart
from openhab-core.
Is it only at the first change or at any next change ?
For me, it works well except the first change.
Please note that the list of things in Main UI is not automatically updated, you have to refresh it.
from openhab-core.
Only first change
from openhab-core.
Only first change
Well, we have the same result.
@jimtng : that is strange that you can't reproduce it.
from openhab-core.
Can I log it somehow more?
from openhab-core.
I was testing it on snapshot build 4064 and couldn't replicate the problem.
I then tried installing build 4065 but encountered a problem when installing the astro binding, maybe because the addon build wasn't done yet (I don't quite understand how the packaging system works). So I tried build 4064 again and still cannot reproduce the problem.
- I stopped openhab
- Then started it again
- Loaded the Main UI page to see the thing label as set in the file
- Then edited the .things file to change the label (add / remove a letter or so)
- Then refreshed the Main UI page, the change of label I made is reflected on the Things page
from openhab-core.
I think there's still a bug. I'm now able to reproduce this under a different set of conditions. Looking into it more!
from openhab-core.
The Bug I found was this:
- When you have a .things file that contain Things from multiple bindings (e.g. Astro and Shelly), it won't work properly. This is a regression that was introduced in #4076
However, I still haven't been able to reproduce the problem when the .things file only contain things from the same binding.
In any case, could you please test this jar file? You will need to clear openhab cache and tmp dirs. Note I had to add a fake .zip extension. This is not a zip file. Just rename and remove the .zip extension and do not unzip it.
org.openhab.core.model.thing-4.2.0-SNAPSHOT.jar.zip
This file needs to be placed inside ./runtime/system/org/openhab/core/bundles/org.openhab.core.model.thing/4.2.0-SNAPSHOT/
- please back up your original org.openhab.core.model.thing-4.2.0-SNAPSHOT.jar
file first!
from openhab-core.
@jimtng Which one do I need to replace?
1)./srv/openhab-sys/runtime/system/org/openhab/core/bundles/org.openhab.core.model.thing.runtime
2)./srv/openhab-sys/runtime/system/org/openhab/core/bundles/org.openhab.core.model.thing.runtime/4.2.0-SNAPSHOT/org.openhab.core.model.thing.runtime-4.2.0-SNAPSHOT.jar
3)./srv/openhab-sys/runtime/system/org/openhab/core/bundles/org.openhab.core.model.thing.ide
4)./srv/openhab-sys/runtime/system/org/openhab/core/bundles/org.openhab.core.model.thing.ide/4.2.0-SNAPSHOT/org.openhab.core.model.thing.ide-4.2.0-SNAPSHOT.jar
5)./srv/openhab-sys/runtime/system/org/openhab/core/bundles/org.openhab.core.model.thing
6)./srv/openhab-sys/runtime/system/org/openhab/core/bundles/org.openhab.core.model.thing/4.2.0-SNAPSHOT/org.openhab.core.model.thing-4.2.0-SNAPSHOT.jar
7)./usr/share/openhab/runtime/system/org/openhab/core/bundles/org.openhab.core.model.thing.runtime
8)./usr/share/openhab/runtime/system/org/openhab/core/bundles/org.openhab.core.model.thing.runtime/4.2.0-SNAPSHOT/org.openhab.core.model.thing.runtime-4.2.0-SNAPSHOT.jar
9)./usr/share/openhab/runtime/system/org/openhab/core/bundles/org.openhab.core.model.thing.ide
10)./usr/share/openhab/runtime/system/org/openhab/core/bundles/org.openhab.core.model.thing.ide/4.2.0-SNAPSHOT/org.openhab.core.model.thing.ide-4.2.0-SNAPSHOT.jar
11)./usr/share/openhab/runtime/system/org/openhab/core/bundles/org.openhab.core.model.thing
12)./usr/share/openhab/runtime/system/org/openhab/core/bundles/org.openhab.core.model.thing/4.2.0-SNAPSHOT/org.openhab.core.model.thing-4.2.0-SNAPSHOT.jar
from openhab-core.
In the meantime I tested also other thing files....the first time it's not changing but than it seems to be fine
from openhab-core.
@jimtng Which one do I need to replace?
The one with the exact same name.
I don't know why you have two.
from openhab-core.
the second one is just a link :) so I have only one.....I used find
to find the location
from openhab-core.
@jimtng looks good for me.....now
I am on openHAB 4.2.0 (Build #4065) with the jar file replaced as @jimtng wrote
I changed the file shelly.things from
Thing shelly:shellyplus1pm:441793cea354 "Plus1PM_Bett_links" @ "Bedroom" [deviceIp="ip", password="password"] Thing shelly:shellyplus1pm:d4d4da7cbde0 "Plus1PM_Bett_rechts" @ "Bedroom" [deviceIp="ip", password="password"]
to
Thing shelly:shellyplus1pm:441793cea354 "Plus1PM_Bett_linkse" @ "Bedroom" [deviceIp="ip", password="password"] Thing shelly:shellyplus1pm:d4d4da7cbde0 "Plus1PM_Bett_rechtse" @ "Bedroom" [deviceIp="ip", password="password"]
in the log I see
2024-05-05 22:30:40.510 [INFO ] [el.core.internal.ModelRepositoryImpl] - Loading model 'shelly.things'
2024-05-05 22:30:40.630 [INFO ] [ab.event.ThingStatusInfoChangedEvent] - Thing 'shelly:shellyplus1pm:441793cea354' changed from ONLINE to OFFLINE (COMMUNICATION_ERROR): Unerwarteter Fehler - WebSocket connection closed abnormal
2024-05-05 22:30:40.656 [INFO ] [ab.event.ThingStatusInfoChangedEvent] - Thing 'shelly:shellyplus1pm:d4d4da7cbde0' changed from ONLINE to OFFLINE (COMMUNICATION_ERROR): Unerwarteter Fehler - WebSocket connection closed abnormal
2024-05-05 22:30:42.617 [INFO ] [ab.event.ThingStatusInfoChangedEvent] - Thing 'shelly:shellyplus1pm:441793cea354' changed from ONLINE to UNKNOWN (CONFIGURATION_PENDING): Initialisierung oder Gerät im Schlafmodus.
2024-05-05 22:30:42.654 [INFO ] [ab.event.ThingStatusInfoChangedEvent] - Thing 'shelly:shellyplus1pm:d4d4da7cbde0' changed from ONLINE to UNKNOWN (CONFIGURATION_PENDING): Initialisierung oder Gerät im Schlafmodus.
2024-05-05 22:30:43.046 [INFO ] [ab.event.ThingStatusInfoChangedEvent] - Thing 'shelly:shellyplus1pm:d4d4da7cbde0' changed from UNKNOWN (CONFIGURATION_PENDING): Initialisierung oder Gerät im Schlafmodus. to ONLINE
2024-05-05 22:30:43.081 [INFO ] [ab.event.ThingStatusInfoChangedEvent] - Thing 'shelly:shellyplus1pm:441793cea354' changed from UNKNOWN (CONFIGURATION_PENDING): Initialisierung oder Gerät im Schlafmodus. to ONLINE
already on the first attemp
changed back from
Thing shelly:shellyplus1pm:441793cea354 "Plus1PM_Bett_linkse" @ "Bedroom" [deviceIp="ip", password="password"] Thing shelly:shellyplus1pm:d4d4da7cbde0 "Plus1PM_Bett_rechtse" @ "Bedroom" [deviceIp="ip", password="password"]
to
Thing shelly:shellyplus1pm:441793cea354 "Plus1PM_Bett_links" @ "Bedroom" [deviceIp="ip", password="password"] Thing shelly:shellyplus1pm:d4d4da7cbde0 "Plus1PM_Bett_rechts" @ "Bedroom" [deviceIp="ip", password="password"]
in the log I see
2024-05-05 22:30:40.510 [INFO ] [el.core.internal.ModelRepositoryImpl] - Loading model 'shelly.things' 2024-05-05 22:30:40.630 [INFO ] [ab.event.ThingStatusInfoChangedEvent] - Thing 'shelly:shellyplus1pm:441793cea354' changed from ONLINE to OFFLINE (COMMUNICATION_ERROR): Unerwarteter Fehler - WebSocket connection closed abnormal 2024-05-05 22:30:40.656 [INFO ] [ab.event.ThingStatusInfoChangedEvent] - Thing 'shelly:shellyplus1pm:d4d4da7cbde0' changed from ONLINE to OFFLINE (COMMUNICATION_ERROR): Unerwarteter Fehler - WebSocket connection closed abnormal 2024-05-05 22:30:42.617 [INFO ] [ab.event.ThingStatusInfoChangedEvent] - Thing 'shelly:shellyplus1pm:441793cea354' changed from ONLINE to UNKNOWN (CONFIGURATION_PENDING): Initialisierung oder Gerät im Schlafmodus. 2024-05-05 22:30:42.654 [INFO ] [ab.event.ThingStatusInfoChangedEvent] - Thing 'shelly:shellyplus1pm:d4d4da7cbde0' changed from ONLINE to UNKNOWN (CONFIGURATION_PENDING): Initialisierung oder Gerät im Schlafmodus. 2024-05-05 22:30:43.046 [INFO ] [ab.event.ThingStatusInfoChangedEvent] - Thing 'shelly:shellyplus1pm:d4d4da7cbde0' changed from UNKNOWN (CONFIGURATION_PENDING): Initialisierung oder Gerät im Schlafmodus. to ONLINE 2024-05-05 22:30:43.081 [INFO ] [ab.event.ThingStatusInfoChangedEvent] - Thing 'shelly:shellyplus1pm:441793cea354' changed from UNKNOWN (CONFIGURATION_PENDING): Initialisierung oder Gerät im Schlafmodus. to ONLINE
from openhab-core.
@lolodomo would you mind testing too please
from openhab-core.
@miloit thanks for testing. I take it that the jar I supplied did fix the problem?
Would you mind testing the following:
- only change the first thing then save the file and watch the log, and
- only change the second thing then save the file and watch the log
It should log that only the changed thing would go offline -> online and the unchanged thing should remain online.
from openhab-core.
@jimtng Yes the jar file fixed the problem
Also the second situation is running fine for me....
from openhab-core.
This issue has been mentioned on openHAB Community. There might be relevant details there:
from openhab-core.
Related Issues (20)
- [marketplace] Supported Bundle Versions No Longer Processed HOT 2
- Allow offset for "at the time specified in an item's state" trigger HOT 7
- customTags.yaml not loading after reboot HOT 6
- Attempting to send a state update of an item which doesn't exist: __v_isRef HOT 7
- Default statedescription pattern for NumberItem HOT 3
- Error during logger activation HOT 3
- Snapshot 4069: failed to install bundles at startup HOT 39
- Missmatch between system:start-level and openhab.event.StartlevelEvent HOT 5
- OpenHAB 4.1.2 - Karaf cannot start HOT 4
- Add SDDP service to core HOT 4
- Sitemap widget grid
- [ephemeris] Calls to `isBankHoliday` failing with exception HOT 6
- Local build failing in config.core due to violation in schema\config-description-1.0.0.xsd HOT 2
- Thing file loading issue HOT 3
- Persisted group items with base type Number:Dimension not restored correctly in persistence extensions HOT 3
- What to do with my 'fake' device code
- Possible Startup loop HOT 1
- Skipping setup causes issues due to locale not being set HOT 2
- [Feature] Add support to format channel-type description using `html` tags HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from openhab-core.