Replacing Smart Bulbs (and other components) without losing automation, rules, and other settings

How many nerds does it take to change a lightbulb?

I’m in the process of adding smart home tech to a family home that will be used by other family members in the coming years. So I’m trying to build a system that can still be used by non tech savvy people in the future.

I’d love to hear about other people’s solutions for building a long lasting system with minimal maintenance, and when maintenance is required, what have you put in place to make it easier?

The most likely thing needing to be done, and the question I am asking now specially, is how to replace Smart Bulbs without losing settings such as:
Pairing to dimmers, switches, and groups/scenes etc.
Color temperature fading from warm to cold in the morning, and then back to warm again at sunset.
Motion sensors
Etc etc

The next logical question would be: What if the bulb is replaced with a slightly different type? Either changing protocol (swapping out a zigbee with a WiFi for example), or going from a tuneable white to RGBWW.

I think if there is a good answer to this, that it will also apply to swapping out other components if there is a problem in the future, or newer tech worth upgrading to.

My hub will be a Pi4 with PiJuice UPS, z-wave usb stick, zigbee cc2531.
I will use openhab 3

For lighting, I plan to use zigbee CCT smart bulbs, Philips Hue kitchen lights, and maybe some WiFi lights too.

For heating, I will put Shelly relays in the on/off switches of my water heater and gas boiler, then control each room with Fibaro Radiator control head.

The sensors I will use include:
Motion/light sensors
Temp/humidity sensors
Door sensors

And I will control stuff with:
Philips hue dimmer
Ikea dimmer
Zigbee buttons
Android tablet mounted to the kitchen wall

There will also be a Sonos speaker in the kitchen.

I may also add cameras, doorbells and a few other things if everything else works out.

At a high level overview, this is what Items are about in openHAB. We can consider them divorced from reality.
All openHAB Dimmer type Items look and act alike, regardless of what technology they are linked to.

So if you build your automation - rules, groupings, UI - based upon Items … that too will be divorced from reality. You can mess with what real devices your Items are linked to, without changing rules, groupings, UI. Hurrah!

The techy tailoring is done at the Thing and channel level.
So, to replace a smart bulb with another of similar type, you should only need to add or edit a Thing. If that remains linked to the same Item, rules etc. are unaffected.
To replace a smart bulb with a different type - it’s still the business of Things and channels. Once again, if the new channel ends up linked to the same old Item then existing rules etc. carry on as before.

So that’s the theory. It will break down a bit when you change significant features of a real device - this old bulb was just dimming, but this new one has color temperature as well. Nothing to be done about that, except careful planning.

You will see people creating rules that directly use channel and Thing events etc. Sometimes you have to, but you also lose the benefits of abstraction by Item.

Build the system so that if OH is offline it’s not that big of a deal. I like the old Mitch Hedberg joke. “You will never see an escalator out of order sign. Only escalator temporarily stairs, sorry for the convenience.” Use “escalators”, not “elevators” in your system where it counts. Try to choose devices and technologies where you still have local physical control (e.g. physical light switch) for the things that matter or have a safety aspect (emergency lighting, HVAC, entry, etc.).

When you do that, in those brief times where maintenance is required, you are not under the gun needing to do the job as fast as possible during off hours so as not to inconvenience your family. When something breaks, at worse that just means the automation is broken, not the ability to control the devices, so your smart home becomes “dumb” for awhile.

Of course, this is not in replacement for good backup/restore and all the rest.

Unfortunately, the above means the smart bulbs are pretty much eliminated for any critical/safety uses except in some specific configurations (e.g. where a smart switch talks directly to a smart bulb without going through openHAB first).

I don’t have anything else to add to what rossko57 said for the second question. That’s what Items are for.