Problem with Shellies via native integration

I’ used to integrate in HA my Shellies via mqtt and they work fine.
Now I would move to the native HA integration but I’m facing some problems.
I loaded and configured the integration and it sees correctly all my Shellies (1,2.5 and EM).
Unfortunately when I pick one from the device list I see the controls graded out and the switch unavailable.

What am I missing?


Is the firmware of the Shelly devices up to date?

Did you enable CoIoT unicast for the generation 1 devices?

yes it is enabled:

It’s not the latest firmware version:

I’m gonna update it now

Firmware updated but the light button is till not working.
I’m using this entity that correctly shows if the light is on or off:

Anyway if I push the button:

how_name: true
show_icon: true
type: button
  action: toggle
entity: light.shelly_shsw_1_ba2205
name: Scale
show_state: true
  action: call-service
  service: light.toggle
  data: {}
    entity_id: light.shelly_shsw_1_ba2205

nothing happens.
The color of the light bulb is correctly updated if I switch on or off the light manually but if I press the button in HA nothing happens.

Actually if you look at the device page I think you will see the device is working now. I can see that by the dev tools states screen shot that nothing is unavailable.

Try toggling the switch in the device page.

I can see the entity but I cannot command the switching of the light.
Clicking on the UI button nothing happens.

Try toggling the switch in the device page.

Screenshot 2022-09-27 at 07-58-22 Settings – Home Assistant

Screenshot 2022-09-27 at 07-58-44 Settings – Home Assistant

Does the toggle change state?

If so then you have wired it incorrectly.

Also, do you have the correct entity?

You appear to be toggling a light instead of a switch.

The shelly1 is wired correctly because it worked fine when it was configured via MQTT and works fine too using the shelly app.
Answering to your question if I toggle the switch in the device page nothing happens and the switch goes back in the off position after few seconds.
What I’m trying to do is to migrate it from old mqtt management to new on with the integration.
According to the documentation you also linked above, HA should have created an entity named with the Device Name or the Channel Name.
My device name (and my channel name too) is scale_luce. So I am supposed to found an entity called scale_luce something but I cannot find it.
I found different entities with a name that I can logically connect to my shelly:

I would like to cleanup all this mess but I’m not sure how to do that.
Which one is the right one?


Got it! If the Shelly has authentication set it simply doesn’t work.
There should be a way to configure username and password for the integration…

Are you sure that’s it?

All my Shellys have authentication set for the web interface.

Sorry for my late answer @tom_l.
Yes, if I enable the authentication I am no longer able to switch the light on/off. As soon as I disable it it works like a charm.
In the logs I have messages like:

2022-10-29 18:10:54.873 WARNING (Update loop) [pyShelly] Error, 401 Unauthorized http://<my_shelly_IP>/settings

Did you enable the authentication before adding the device or after?

Before. Usually I configure the device enabling the authentication and then I add it to HA.
Anyway in my tests I also enabled/disabled the authentication many times with the device already configured in HA.
Let me say that I would expect to need to put somewhere the auth credentials. In fact it would be crazy if I set any kind of authentication on the device but I could send it some commands anyway despite this.

CoIoT does not require credentials as far as I am aware. The username and password are just for the web interface.

Are the devices in the same subnet as HA?

Yes both HA and Shellies are in the same subnet.

same issue here;( can see the shelly em but not showing all the info… using the hacs integration i can see everyrhing