How many software engineers does it take to replace a light bulb in HA?

Sorry for the tongue in cheek topic, but seriously, I tried replacing one (tasmota flashed) light bulb that made a buzzing noise with another. I set the name the same, the same MQTT topic, client id, and even IP address, but tasmota still recognizes it as a new and different light bulb and thus I need to update all my scripts, scenes and automations. How can I change or assign a device entity?

The software engineers won’t get out of their chairs in case they miss an error message…

The bulb will therefore never be changed.


give the light a simple name in HA and don’t use the complex names some of these integration tend to give to the entities.
That way you only need to rename each individual entity, and keep al your other logic as it is.

you’ve got to show us what the entity is named in HA, before we can help.

but tasmota still recognizes it as a new and different light bulb

Probably because of retained config mqtt messages.

You can replace a light and use the same genertated entity id:

  1. disconnect the light and delete the integration. In the case of mqtt this is a PITA. Because all your entities are in the one mqtt integration.
  2. delete any retained topics and messages from the mqtt broker relating to the light with a client like mqtt-explorer
  3. Restart home assistant
  4. connect the new light with the same client id, topic etc…

The light entity in question is called : light.tasmota_tv
The one I tried replacing it with got named light.tasmota_tv_2 despite replicating all its settings in tasmota afaik. So i guess there is some sort of unique ID. Anyway, Id need that light.tasmota_tv_2 to be renamed to light.tasmota_tv

which can easily be done, probably by clicking on it in the devices setting in configuration.

or, if you dare, in the hidden .storage files, but that isn’t advised if you dont know what you do.

If there is no longer a light.tasmota_tv entity you should be able to rename `light.tasmota_tv_2’ in the integration or entity menus.

If it tells you an entity already exists with that name even though you no longer have it connected you need to clear out the retained mqtt config topic for that light. e.g.

1 Like

Ah, that should work. Indeed, i get the error that the entity already exists. Where do I find that MQTT explorer? Im using the default mosquitto broker.

There’s this fandangled thing called google which will lead you to a download for MQTT Explorer.


My experience with people who need to change [1] is that the light bulb needs to want to change…

[1] usually to stay out of jail.


My bad, I assumed this was something I could do from within HA.

Im not sure how to explain this to my SO when a light bulb breaks it will take me an hour to replace it (mostly the tasmota stuff), but lets hope that wont happen too often.

Well no… it’s just ignorance. Next time if/when it happens with this experience under your belt 1 minute tops… (i have not replaced any components in 2 years BTW and use Tasmota on a bunch of switches too)

Why should they, it’s a hardware problem ?


This also depends upon your platform.
The primary reason I chose z_wave light switches (other platforms are available) was that if I’m away, when a bulb goes, the wife can just get another dimmable bulb (of the same type) out of a box and screw it in. If the network or HA goes down (let’s not pretend it doesn’t even if it’s because of some stupid thing I’ve done) then she can still (so no change there for her) switch it from the wall switch.
When I sell the house (the wiring was set up to accommodate either dumb wiring or smart switches) who knows what the prevailing technology will be? Or if the new owner is a technophobe 70 year old lady, the switches can be removed and you are left with a working system.
How long does it take me to change a light bulb - well, as long as it takes to change a light bulb :man_shrugging:
Okay; like for like : - how long does it take me to change a light switch ? Well I have a naming convention for the device and thus all its sensors/attributes. I pair the device, delete the old entities and rename the new entities to the old entity names. Its a bit longer than 2 minutes as I need to get the old switch out of the wall, set the new one up in my test rig to pair and then reinstall. I don’t expect to replace ANY switches in the next 15 years, so about 30mins??? Tops ! it’s a price I’m willing to pay if the MTBF bites me in the ass.
Plan your systems for usability/longevity/value/maintenance and if you don’t or run into problems then that’s a learning experience.

1 Like

I have 4 smart bulbs in the house. I hate them. The exact problem I was concerned about before getting them happens nearly daily. That problem is the stupid little switch on the wall. If someone walks by and turns that switch off, the damn bulb has no power…and I have no control over that damn bulb.

This is why I went with zwave switches everywhere I could. One time hassle of installation, and I don’t have to worry about training my family on correct usage. Lol.


Apparently Inovelli has fixed this problem with their latest Red Series generation of switches and dimmers as you can program them to maintain power to the load at all times. I’m currently begging for spousal approval to get a bunch of them, they look pretty awesome but they are a little expensive.

1 Like

Moe was suggesting that though the issue arises over the ‘damn switch’ the problem is the bulb.
If you do it properly, you fit the switch, and the wife is completely unaware of the difference :smiley:

1 Like

The hardware guys said the software was tripping the flux capacitor.


1 minute? Not exactly if you take everything in to account. Im not just talking HA here. You open the box of your bulb, and then:

  • boot up raspbian on a spare Pi with wifi, and if need be, ssh in to it via ethernet, or connect keyboard/monitor. Downloaded latest tuya-convert.
  • start AP on pi
  • connect phone to pi AP (and somehow make it stay connected even though it has no internet)
  • set bulb in pairing mode and have it discovered by tuya-convert. This maytake several attempts and (way) more than a minute
  • backup firmware and start flashing procedure (this alone also takes about a minute)
  • Restart bulb and connect phone to bulb’s tasmota AP
  • Connect browser to tasmota web interface
  • Configure wifi SSID and password on the bulb and restart bulb
  • Find out IP address of the bulb on your home wifi. Not so easy on some routers (my nova mesh app is a night mare for this, I can only see IPs by clicking every device name and even Fing struggles to detect devices on my lan).
  • connect phone to bulb web interface
  • configure bulb’s tasmota template and device name, restart. If you didnt buy the exact same type bulb or another one thats listed on tasmota’s site, this may take a few or even many tries to get right.
  • configure tasmota module, restart
  • configure MQTT host/user/pw/topic, restart
  • open tasmota console and set static IP, restart, optionally set speed/fade settings, and HA autodiscovery

Now you can start in HA. If you do multiple bulbs, tasmoadmin plugin can save you a little bit of time, but most of the steps are still required.

Ive flashed and configured 8 bulbs over the past week. I didnt time it, but I dont think I did a single one in under 20 minutes and that was doing some of them in batches with the pi booted and ready, the procedure fresh in my memory. In 6 months, it wont be, and Ill probably need to google this very post first :wink:

in the distant future, it would be neat to have a “firmware cloning” option; you select an existing bulb from within HA, and create a firmware with everything preconfigured, or the possibility to change a few things like name/topic/IP if its for an additional bulb, then flash that to the new bulb. Maybe you could get close to 1 minute then and our significant others might be able to replace a bulb.

1 Like

A very simple solution to that: a bit of transparent tape to lock the switch in place. May not work with every type, but Im sure you’ll find something that works for yours, with tape or sugru or something. Better yet, you open the switch and connect the wires, bypassing the switch. Even better: put a smart switch in its place.