Tasmota registers devices as light not switch? how to change?

Hi all,
Some time ago, I changed my sonoff basic devices from MQTT over to the Tasmota native integration, and it works really well.

I’ve recently discovered though, that the sonoff basic devices are registered as light such as light.sonoff1. I tried modifying the entity and I ended up with a broken install, and had to roll back.

Does anyone know how to change the domain of the sonoff basic Tasmota devices from light to switch?

Thanks

you can either use the helper “change switch to x”
grafik

But that will probably not enable other options such as “dimming” or color / temperature adjustments.
In that case, you might open a ticket with the guys that support the tasmota integration.

What technology are your devices?
ESP / WiFi / Zigbee?

Since you are running Tasmota, I think these are ESP based devices … so ESPHome could also be an option…?
If they are using Zigbee - then, ZHA or Z2M could be also another option for you?

But I haven’t done anything with Sonoff Tasmota stuff so far, so I am not sure about this.

The devices in question are sonoff basics, so they are definitely not lights:

Will this turn a light into a switch or only from a switch?

I don’t think I care about “dimming” or other light features with these devices, as long as my other actual lights can work as normal.

Is the helper an addon or can I find it?

Ah!
I see :slight_smile:
In my humble opinion: I would leave this as “light”.
I have a similar device for a LED Strip - and since it is supposed to controll light entities, I would consider it as expected behave - to be recognized as light entity.

Anyway:
You will find the helper where you add integrations:
grafik

But usually, it will turn a switch into other domains… not vice-versa … Sorry, haven’t recognized this the first time…

That’s interesting, thanks for your advice finding the helper.
I went to the Helpers menu as advised, but it looks like there is no option or even way to find the “Change device type of a switch” menu, even for the other entities.

It might be that the Tasmota integration is creating read-only entities or something.

Seems like I might be stuck with these, what a bummer.

Should be there

Hey thanks for pointing this out, I finally found the menu, it was called “Switch as X” similar to your first pointer.
image

Then it shows up more or less as expected.

Unfortunately, I’ve poked around at the options and other helpers and there seens to be no light to switch option. Unfortunate.

Thanks for the advice though, I’m sure this will come in handy in future.

hm… while I still think that the classification as “light” could be considered as correct (as far as I know, these devices are used to be light controllers / drivers for lights) - I am not sure, if the helper should be capable to change a device of the light domain to a switch - or another device class… but my recommendation would be, to raise an issue to the developers of this integration (is it the core, or a custom one?)

They might change the device class to switch - that would probably allow the greatest flexibility, because then you could change it to one of these device classes:

  • Cover
  • Fan
  • Light
  • Lock
  • Siren

I can see what you mean, but I’m just speaking as someone that uses these devices and observed others using them.

As far as I’m aware, these devices are low-cost and general purpose switches that can be used for basically anything, and (just my opinion) I would say they are definitely not leaning towards light controllers in particular, but it is definitely part of their use case.

I personally use them to control fans, power sockets, a venitlation system, a bathroom air extractor, and some other home devices, but I’ve never used these for a light or lamp, but I could.

Much of the issue I’m encountering now with these sonoff basics being light devices is around the migration I performed in this thread, where I migrated from the tasmota-MQTT backend to the tasmota-integration backend.

After performing this migration, all my “sonoff basic” devices show up as light entities, and were previously switch entities.
What I find especially interesting, is that I also own other sonoff devices like a few “sonoff POWR2”, and they show up as switch entities. Its a little baffling, because these were migrated as well in the same way, at the same time.

I’m not sure how to address this issue, but I might have to log a bug or issue in the integration github or something. It seems inconsistent to me.

It looks like this is a core integration, according to this.

Any ideas of what I could do?

open a ticket in the git for the Core with pointing to the integration you are using. :slight_smile:

Just finished creating an issue:

If you currently have setoption30 0 you have an issue to report.
If you currently have setoption30 1 it is the correct behaviour.

SetOption30	Enforce Home Assistant auto-discovery as light

            0 = relays are announced as a switch and PWM as a light (default)
            1 = both relays and PWM are announced as light

tasmota setoptions