Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[mercedesme] Fix trip channel type id #17267

Merged
merged 5 commits into from
Aug 28, 2024

Conversation

weymann
Copy link
Contributor

@weymann weymann commented Aug 15, 2024

Fixes #17265

@lolodomo lolodomo added rebuild Triggers Jenkins PR build and removed rebuild Triggers Jenkins PR build labels Aug 18, 2024
@lolodomo
Copy link
Contributor

Please also provide upgrade instructions for an automatic update of existing things.

@lolodomo lolodomo added the bug An unexpected problem or unintended behavior of an add-on label Aug 18, 2024
@lsiepel lsiepel requested a review from a team August 18, 2024 20:20
@lsiepel lsiepel changed the title [mercedesme] bugfix trip channel naming [mercedesme] Fix trip channel type id Aug 18, 2024
Signed-off-by: Bernd Weymann <bernd.weymann@gmail.com>
Signed-off-by: Bernd Weymann <bernd.weymann@gmail.com>
Signed-off-by: Bernd Weymann <bernd.weymann@gmail.com>
@weymann weymann force-pushed the fix/trip-channel-naming branch from 18d2692 to 6799c30 Compare August 26, 2024 17:08
@weymann
Copy link
Contributor Author

weymann commented Aug 26, 2024

Please also provide upgrade instructions for an automatic update of existing things.

Is there a way to test the instructions?
I tried bundle:update in openHAB console and the errors are disappearing. But shouldn't the channels be added automatically after updating?

@lsiepel
Copy link
Contributor

lsiepel commented Aug 26, 2024

Please also provide upgrade instructions for an automatic update of existing things.

Is there a way to test the instructions? I tried bundle:update in openHAB console and the errors are disappearing. But shouldn't the channels be added automatically after updating?

The instructions are wrong, they should be update not add. See https://www.openhab.org/docs/developer/bindings/thing-xml.html#updating-thing-types

to test you would configure a thing with the previous bj ding version. Uninstall the binding, drop the jar in the adobe folder and it should be updated with no errors in the log.

@weymann
Copy link
Contributor Author

weymann commented Aug 26, 2024

to test you would configure a thing with the previous bj ding version. Uninstall the binding, drop the jar in the adobe folder and it should be updated with no errors in the log.

Fine, this is what I'm testing since days.

Setup

  • Install released binding from Add-on Store
  • Create Things - errors in log, Channels are not visible in Thing - Channels Tab

Update
I tested in all possible combinations

  • update-channel in instructions.xml
  • add-channel in instructions.xml
  • dropping bundle into addons folder after removal of released binding
  • bundle:update via openHAB console to update released binding - see picture below

Result
All combinations above are showing the same result.

  • The Things created with released binding are not updated - same channels as before
  • New Things created are fine - no errors, no missing channels

I'm desperately seeking and trying if an id or type is wrong but so far I cannot explain what's wrong.

image

Signed-off-by: Bernd Weymann <bernd.weymann@gmail.com>
@lsiepel
Copy link
Contributor

lsiepel commented Aug 27, 2024

  1. Install released binding from Add-on Store
  2. Create Things - errors in log, Channels are not visible in Thing - Channels Tab
  3. Dropping bundle into addons folder after removal of released binding
  4. bundle:update via openHAB console to update released binding

As the thingtypeversion needs to be updated each time, you can not do this on your an instance you already used. You need a fresh openHAB instance to start with.

@weymann
Copy link
Contributor Author

weymann commented Aug 27, 2024

As the thingtypeversion needs to be updated each time, you can not do this on your an instance you already used. You need a fresh openHAB instance to start with.

Ok, all I want to know if I can test test the instructions.xml or not. From your last comment it looks like I'm not able to test it. So I trust on your latest remark and provided already the update-channel instructions.

@lsiepel
Copy link
Contributor

lsiepel commented Aug 27, 2024

As the thingtypeversion needs to be updated each time, you can not do this on your an instance you already used. You need a fresh openHAB instance to start with.

Ok, all I want to know if I can test test the instructions.xml or not. From your last comment it looks like I'm not able to test it. So I trust on your latest remark and provided already the update-channel instructions.

It is testable, but because it was already tried you need a new openHAB instance to retry

@weymann
Copy link
Contributor Author

weymann commented Aug 27, 2024

It is testable, but because it was already tried you need a new openHAB instance to retry

Please enlighten me.
I've everything available. A raspi free available which I can install/update/upgrade at any time.
What are the steps to test this PR in order to check the instructions.xml correctly with my own bundle I build on my machine or github?

@jlaur
Copy link
Contributor

jlaur commented Aug 27, 2024

It is testable, but because it was already tried you need a new openHAB instance to retry

That is not needed. When you go back to the previous version (any version before this PR) and create a Thing, that Thing will be created with the previous thingTypeVersion. After that, install the new version again, and the upgrade will be triggered. You can check the thingTypeVersion property before and after, and if it's incremented by 1, the upgrade succeeded. If the channels are not fixed then, the instructions are probably faulty. When the instructions are executed, there should also be something logged in case of errors.

@lsiepel
Copy link
Contributor

lsiepel commented Aug 27, 2024

It is testable, but because it was already tried you need a new openHAB instance to retry

That is not needed. When you go back to the previous version (any version before this PR) and create a Thing, that Thing will be created with the previous thingTypeVersion. After that, install the new version again, and the upgrade will be triggered. You can check the thingTypeVersion property before and after, and if it's incremented by 1, the upgrade succeeded. If the channels are not fixed then, the instructions are probably faulty. When the instructions are executed, there should also be something logged in case of errors.

Good addition to check the thingtypeversion. I always use a new instance, have had too many issues because previous upgrades, same thing uids etc. But it is not essential.

@lsiepel lsiepel added rebuild Triggers Jenkins PR build and removed rebuild Triggers Jenkins PR build labels Aug 28, 2024
Signed-off-by: Bernd Weymann <bernd.weymann@gmail.com>
@weymann
Copy link
Contributor Author

weymann commented Aug 28, 2024

Thanks for the hint to check thingTypeVersion in previous created things.
With this I realized no update was performed on the previous things and my stupid error was simply instructions.xml was placed in the wrong folder :(

Now old things are updated with correct thingTypeVersion and channels are updated correctly.

Many thanks for helping!

@lsiepel
Copy link
Contributor

lsiepel commented Aug 28, 2024

Thanks for the hint to check thingTypeVersion in previous created things. With this I realized no update was performed on the previous things and my stupid error was simply instructions.xml was placed in the wrong folder :(

Now old things are updated with correct thingTypeVersion and channels are updated correctly.

Many thanks for helping!

lol sorry I didn’t notice that too

Copy link
Contributor

@lsiepel lsiepel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@lsiepel lsiepel merged commit 1bc932e into openhab:main Aug 28, 2024
5 checks passed
@lsiepel lsiepel added this to the 4.3 milestone Aug 28, 2024
digitaldan pushed a commit to digitaldan/openhab-addons that referenced this pull request Aug 29, 2024
* bugfix trip channel naming

Signed-off-by: Bernd Weymann <bernd.weymann@gmail.com>
pgfeller pushed a commit to pgfeller/openhab-addons that referenced this pull request Sep 29, 2024
* bugfix trip channel naming

Signed-off-by: Bernd Weymann <bernd.weymann@gmail.com>
Signed-off-by: Patrik Gfeller <patrik.gfeller@proton.me>
joni1993 pushed a commit to joni1993/openhab-addons that referenced this pull request Oct 15, 2024
* bugfix trip channel naming

Signed-off-by: Bernd Weymann <bernd.weymann@gmail.com>
matchews pushed a commit to matchews/openhab-addons that referenced this pull request Oct 18, 2024
* bugfix trip channel naming

Signed-off-by: Bernd Weymann <bernd.weymann@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug An unexpected problem or unintended behavior of an add-on
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[mercedesme] Cannot find channel type: mercedesme:consumption-conv-resetchannel
4 participants