OH3 how best to delete an add-on and all related things and items?

Hi all,
I am looking into the move to OH3 and like many of us, I have had a change to the direction I am going and decided that I no longer wanted to integrate OH3 with the Hue binding/add-on and should therefore uninstall it, then I realised I had left the ‘things’ orphaned so I needed to go through each of the 25 or so things and remove them, then I realised they were just sitting there identified as removing. So I then went into each of them and deleted them. next taking a look at the items I see scores of items that were dependant on the things that are now orphaned. I will now start the process of going through a 1000 long list of items and removing the ones that are orphaned.

My question is this, I obviously did not not do this in the best way, but what is the best way to remove an add-on and all the dependant things and items?

I have a few more add-ons I suspect I will be making a change of direction in real soon so the optimal way to remove and clean up OH3 rather than endless clicking would be handy.

Thanks
Paul

I just tried removing a couple of Things. I’m no longer using Grafana, Grafana Image Renderer nor am I using InfluxDB and I had some Network Binding Things to monitor those service’s status.

  1. Clicking on Select and selecting a couple of Things worked to delete the Things. However, the Link and the Item remained. :frowning: But wait, maybe I’m not waiting long enough because the Link appears to go away on its own later.

  2. I went into the Thing’s page and clicked delete from there. The Thing deleted and more importantly the Link was also removed. But the Item remains.

  3. I go to the Link from the Item and click “unlink” and the Link gets deleted but not the Item. This may have been a false test though because shortly thereafter all the links for the Thing Things I deleted went away on their own.

  4. I think, if I go to the Link from the Channel (can’t test that now because I deleted the Things already) and click “unlink” it will ask if you want to delete the Item. I know I’ve seen that dialog before.

So this looks like a use case that isn’t really supported well. And that’s not wholly unreasonable. People change what Items are linked to all the time. You may not want to have the Items automatically deleted. For that matter you may not want you Things and Links automatically deleted when you delete the binding either. For example, you are moving from Hue to Zigbee I presume? So your end devices are going to be largely the same and they will largely be controlled the same way. So why would you want to delete the Items? Don’t you just want to link them to the new Things and leave them unchanged? There might be a few Items you want to remove related to the Hue Bridge Thing perhaps but that’s not a 1000 long list, that just a few.

In another example, let’s say you want to test out a testing version of a binding to see if it fixes a bug. If all your Things and Links and Items are removed when you uninstall the binding you have a whole lot of new work to do just to test that updated binding.

Have you been using the semantic model? Finding the Items should be pretty easy from the model. You know that the kitchen light bulb’s Items need to be relinked. So you can find the Kitchen lightbulb pretty easily by browsing your semantic model. Just go to the Kitchen Location and the light bulb Equipment.

The select and search is also pretty useful on the Items page. Click on Select in the upper right corner and then start searching for the Item you want to remove. It searches both the Item name and the Label so if you’ve used meaningful names and labels you should be able to figure out which Items represent which physical Hue device. Check the ones you want to delete and then click “Delete” at the bottom.

Anyway, the way I’ve gone about this (I had a change in direction for some of my devices) was to:

  • Leave the Items
  • I can’t remember but I think I left the Links and they sorted themselves out
  • Delete the binding
  • Install the new binding
  • Discover the Things
  • Relink the Channels to the Items

If you have a lot of Items, it might be easier to do the following though:

  1. Use the model and items page select and search to delete the Items and Equipment Group Items.
  2. Use the Thing’s page “sort by binding” select and check all the Things for the binding you plan to remove.
  3. Uninstall the binding
  4. Install the new binding
  5. Rediscover the Things
  6. From the Model page “create equipment from Thing” to recreate the Items.

But if you’ve already rules and pages and sitemaps and such that are using the old Items, you need to be very diligent to make sure the new Items end up being named the same when you recreate them.

I guess the issue here is I am trying to work out a way forward and trying different things, this means I need to keep cleaning up so that when I try the next new thing I work from a baseline.

I have a reasonable well functioning 2.x install. And now need to look at a few major changes as well as the move from OH2.5.11 to OH3.x, in order to do that I need to work out some migrations steps and make sure that I can keep as much functionality as possible whilst I do all the changes, to keep family peace.

The changes I can see are:

  1. Mosquitto on OH server to one on a different server
  2. MQTT1.x to MQTT 3.x
  3. Hue Controller to deCONZ
  4. Xiaomi Gateway to deCONZ
  5. Move from expires 1x binding to ???
  6. Move from WOL 1x binding to ???
  7. Remove dependency or migrate from HTTP binding 1.x
  8. Unpick Plex 1.x binding integration (never really used the OH integration enough to want to keep it.
  9. configure and bring on line all the 2.x bindings

I have completed item 1 only, and I am looking at #2 and #3 currently both are confusing me and I am getting quite discouraged. Hence the need to ‘play’ and revert back. As I have it all on VM I think I need to possible take the snapshot route for my baselining.

With the idea that snapshots will allow me to return to a place is there an easy way to ‘factory default’ OH3 so I can sttart again, armed with my current learnings?

Thanks

Paul

The functionality of the old Expire binding has been incorporated into the core of openHAB, so you don’t need to change anything. Syntax is exactly the same. You can tick this one off your list!

WOL has been integrated into the Network Binding - see this section at the end of the docs for details. Just make sure your Network Thing configuration includes the MAC address of the device.

What’s the confusion for #2?

On the actual topic of this thread, I found that Links seemed to linger for some time, which was quite confusing at first. In the end I went to the API Explorer in the Developer section and deleted the Links through there. When using the UI, I now:

  1. Unlink the Item from the Channel
  2. Delete the Item
  3. Delete the Thing
  4. Delete the Binding
1 Like

Assuming it’s apt installed, I think apt purge openhab will delete everything. Then apt install it again and you’ll be back to a brand new install.

There are several tutorials about MQTT including one of the examples in the Getting Started Tutorial: Adding Things - Advanced | openHAB. Here’s a link to a forum tutorial that explicitly addresses migration: Migrating MQTT1 items to MQTT2.4 items though it’s old and written for 2.5 so it shows PaperUI instead of MainUI.

And please ask for help where needed.

3 and 4 I can’t help with.

5 doesn’t require you to do anything. The binding’s functionality has become a part of the core and the way to configure it is identical to the 1.x binding.

  1. WOL has moved to the Network Binding.

  2. There is a new HTTP binding. Once you migrate your MQTT it shouldn’t be too hard to migrate your HTTP stuff as well.

  3. Should just need to remove the Items and references to those Items, or more likely simply don’t migrate that stuff over to OH 3.

  4. This isn’t a separate step. This should be done one by one for each binding so as not to overwhelm yourself with work and changes all at once.

1 Like

I was just doing something else and noticed this from the Channels tab of a Thing:

@hafniumzinc, thank you for some great input. WOL looked so easy and I only use it for my own PC I moved it to the top of the list to get done, seeing it was low hanging fruit. The expires binding being merged into core makes total sense as it is SO awesome.

I still have some playing to do with OH3 to get comfortable I feel. I think returning to a new install as suggested by @rlkoshak is a good way for to get back on the horse.

From your deletion process I did it in complete reverse and tried from the binding going down to the items, and to Rich’s earlier points it is an unusually use case to want to delete iit all and not keep some of it for reuse. I guess I am sick of looking at the clutter in my 2.5 version and looking for ways to improve on my clean-up activity as soon as it becomes too much of a chore, I know I will end up leaving the debris behind, as I am quite lazy when it comes to configuration tidiness.

@rlkoshak I do indeed use apt so I will give your suggestion a try, Thanks!
I have been reading a LOT about the MQTT migration and seen a few contradictions in amongst the same messages, this has led to the confusion I suspect. I will take a look at the links you have provided and see if I can get some more clarity, along with my plan to baseline and snapshot I should start to make progress.

Your response to #9 was interesting, my current plan of attack was to operate my OH2.5 system in parallel to OH3, some of the common bindings that could allow for multiple connections to external accounts or were simply to use on two systems simultaneously I was looking to do up front, some examples are, openweather, ntp, network astro etc…
Items that have small well package use cases can be done either at the begining or the end, for example icloud, http and execcommand come to mind.
The items that are fundamental for my setup are,

MQTT, Zigbee and AmazonControlEcho binding most of work is in this area and where my playing needs to get me comfortable. I was considering these three areas could be migrated room by room, as every room has at least two if not all three items present.

The timeofday I guess is now the scheduling section and I need to look at that before I start the migration too as I have quite a lot of cron triggered rules.

I think no matter how I do this migration it is going to become messy at some point and so getting the playing right upfront is going to help me when figuring out what’s gone wrong when I migrate. This is certainly a fork lift upgrade for me and I need to make sure I am as ready as I can be. And just to pitch in amazon completely screwed up my smart devices and groups yesterday as I obviously need more issue to look at whilst still on holiday :slight_smile:As voice input is my main form of using my home I need to divert my attention to getting the echo stuff sorted ASAP as I had not touched it in weeks I can think its something they have played with on their side :frowning: Which means I can end up ‘fixing’ it at my end and they change it a gain at their side that breaks it again, you have got to love it :smiley:

Thanks guys for some great assistance and helpful comments.

Paul

I’ve a version of Time of Day published to GitHub - rkoshak/openhab-rules-tools: Library functions, classes, and examples to reuse in the development of new Rules.. All you need to do is install the dependencies (i.e copy a couple of files to the right Locations) and paste the YAML into a new rule. Then everything is driven by Item metadata and Ephemeris. You don’t have to touch the code.

All the schedule is is a calendar showing when rules with time or cron based triggers and tagged with Schedule are going to run. Nothing more, nothing less.

I started adding some basic bindings this morning and got NTP as I wanted. Network I have started to populate, there is at least enough different types for me to play with now. I also added astro and made a mistake.
I placed the Local Moon equipment under my ‘Anywhere’ location instead of my ‘wellington’ Location. See attached image.

After much scratching of head and clicking all over the place, I cannot seem to find a way to move an equipment’s location. This could be an issue as my current thinking is that the equipment could be placed in a location and presumably if later on I change things around I would want to move the equipment to the correct room. So I am either completely heading down the wrong path with my thoughts on location and equipment types or I have overlooked a simply way to move equipment?

Regards

Paul

You should be able to:

  • Items from the left hand side
  • Find your Equipment in the list, and click on it
  • Edit top-right
  • Under Group Memberships click Parent Group(s) and remove your Item from its current location, and select your new location.

Navigate to the Local Moon Item’s page. Change the Parent Groups to the Welington Location Group.

Or navigate to the wellington Group and change it’s members to include the Local Moon Item. Then remove Local Moon from the Anywhere Group.

Putting a Point in an Equipment or Location is done through Group membership. Similarly putting an Equipment in a Location or another Equipment is done through Group membership So to move them all you have to do is change the Group membership.

The responses make sense but when I go to action them I get stuck and end up confused again.

I get that we have essential now got a scheme for groups that includes elements such as location, equipment and points this is to provide better conversational data extraction in the future, at least that is what I am thinking its for.

I managed to remove the 'local moon equipment from the ‘AnyWhere’ location, see below.

Now when I look at the item ‘Local Moon’ it clear still has a reference to AW - this is the name of the “AnyWhere” Location, Anywhere is just the label for AW.

Editing this item and looking for the Direct Parent Groups, leads me to this screen.

Then tapping on the chevron at the end of the 'Parent Groups, led me a list of stuff that I did not expect.

After going backwards and forwards, rereading the emails a couple of times I tried the three lines symbol at the left side of the Parent groups line and got what I expected a list of locations to choose from.

Now I select the correct location and I am away. I decided to write up the journey with images as it was not obvious to me, even after reading the great responses.

I confess I am finding it difficult to navigate the new structure and interface and will take longer to play then I initially planned. I find that the large amounts of wasted real estate with small text and difficult to see navigation is becoming the “normal” UI experience so OH3 is certainly not unique with these UI choices. Unfortunately being visually impaired much of the modern ‘look n feel’ does not have accessibility in mind, and has things like low contrast, and small thin fonts. I also see text as images creeping back in which is really bad for me as my screen reader cannot deal with them.

Anyway I got the location changed and I big shout out to @hafniumzinc and @rlkoshak for their assistance.


[EDIT]
I thought it was all dusted, and just to verify I checked that ‘Local Moon’ was no showing under the WN location, but it was not, nither is it showing under AW either. The item still displays the Direct Parent Group as WN but I cannot see it listed. I seem to have made it hidden, after messing around I think I had removed the equipment. I used the models capability to create equipment from thing and recreated the Local Moon, and was able to then move it into the correct location under WN. :slight_smile: I am learning albeit slowly.

Thanks
Paul

That’s a list of all your Groups.

I think filing Issues on the openhab-ui repo with accessibility concerns like these would be very helpful to the project over all.

It was meant to be helpful. Reading back I can certainly see what you mean too.

I did find something out about my use of a UI, I naturally look to the right for the control and the left for the decryption, having controls all over the place like in the more modern UI layouts totally confuses me :slight_smile:

Regards
Paul