Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Shelly 1, 2.5 and Dimmer cant be loaded with 2024.1.1 #107275

Closed
H4rl3k1n opened this issue Jan 5, 2024 · 36 comments · Fixed by #107294
Closed

Shelly 1, 2.5 and Dimmer cant be loaded with 2024.1.1 #107275

H4rl3k1n opened this issue Jan 5, 2024 · 36 comments · Fixed by #107294

Comments

@H4rl3k1n
Copy link

H4rl3k1n commented Jan 5, 2024

The problem

I installed 2024.1.1, all shellys 1, 2.5 and dimmer were not loaded, Plug S and RGBW worked.
All my shellys have latest, original, firmware.
Seems Tasmota flashed shellys are working (response from facebook-group).
Also it seems only docker version has a problem.

What version of Home Assistant Core has the issue?

2024.1.1

What was the last working version of Home Assistant Core?

2024.1.0

What type of installation are you running?

Home Assistant Container

Integration causing the issue

Shelly

Link to integration documentation on our website

https://www.home-assistant.io/integrations/shelly/

Diagnostics information

No response

Example YAML snippet

No response

Anything in the logs that might be useful for us?

No response

Additional information

No response

@home-assistant
Copy link

home-assistant bot commented Jan 5, 2024

Hey there @balloob, @bieniu, @thecode, @chemelli74, @bdraco, mind taking a look at this issue as it has been labeled with an integration (shelly) you are listed as a code owner for? Thanks!

Code owner commands

Code owners of shelly can trigger bot actions by commenting:

  • @home-assistant close Closes the issue.
  • @home-assistant rename Awesome new title Renames the issue.
  • @home-assistant reopen Reopen the issue.
  • @home-assistant unassign shelly Removes the current integration label and assignees on the issue, add the integration domain after the command.
  • @home-assistant add-label needs-more-information Add a label (needs-more-information, problem in dependency, problem in custom component) to the issue.
  • @home-assistant remove-label needs-more-information Remove a label (needs-more-information, problem in dependency, problem in custom component) on the issue.

(message by CodeOwnersMention)


shelly documentation
shelly source
(message by IssueLinks)

@mbo18
Copy link
Contributor

mbo18 commented Jan 5, 2024

Any log? Just upgraded from 2023.12.3 to 2024.1.1 and the integration does not load anymore. Got these logs:

Logger: homeassistant.config_entries
Source: config_entries.py:406
First occurred: 19:11:52 (3 occurrences)
Last logged: 19:11:52

Error setting up entry Volet roulant Cuisine for shelly
Error setting up entry Shelly EM E4550e for shelly
Error setting up entry Volet roulant Salon for shelly
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/config_entries.py", line 406, in async_setup
    result = await component.async_setup_entry(hass, self)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/shelly/__init__.py", line 131, in async_setup_entry
    return await _async_setup_block_entry(hass, entry)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/shelly/__init__.py", line 201, in _async_setup_block_entry
    await _async_block_device_setup()
  File "/usr/src/homeassistant/homeassistant/components/shelly/__init__.py", line 168, in _async_block_device_setup
    shelly_entry_data.block.async_setup()
  File "/usr/src/homeassistant/homeassistant/components/shelly/coordinator.py", line 338, in async_setup
    super().async_setup()
  File "/usr/src/homeassistant/homeassistant/components/shelly/coordinator.py", line 139, in async_setup
    hw_version=f"gen{self.entry.data[CONF_GEN]} ({self.model})",
                     ~~~~~~~~~~~~~~~^^^^^^^^^^
KeyError: 'gen'

I have 2 shelly 2.5 and one Shelly EM on latest firmware. All do not work now.

@H4rl3k1n
Copy link
Author

H4rl3k1n commented Jan 5, 2024

yes i had the same log, keyError "gen"

@jorgempinto
Copy link

I have exactly the same issue after upgrading from 2024.1.0 -> 2024.1.1

@mpepping
Copy link

mpepping commented Jan 5, 2024

+1 .. OK after downgrading to 2024.1.0

@crudolphy
Copy link

Please see my comment in issue 107277

@playabeach
Copy link

Same problem here, since the update, I hope it will be solved soon

@Cyrelion
Copy link

Cyrelion commented Jan 5, 2024

downgrade via ssh "ha core update --version 2024.1.0" worked for now

@lobolobo
Copy link

lobolobo commented Jan 5, 2024

Any log? Just upgraded from 2023.12.3 to 2024.1.1 and the integration does not load anymore. Got these logs:

Logger: homeassistant.config_entries
Source: config_entries.py:406
First occurred: 19:11:52 (3 occurrences)
Last logged: 19:11:52

Error setting up entry Volet roulant Cuisine for shelly
Error setting up entry Shelly EM E4550e for shelly
Error setting up entry Volet roulant Salon for shelly
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/config_entries.py", line 406, in async_setup
    result = await component.async_setup_entry(hass, self)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/shelly/__init__.py", line 131, in async_setup_entry
    return await _async_setup_block_entry(hass, entry)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/shelly/__init__.py", line 201, in _async_setup_block_entry
    await _async_block_device_setup()
  File "/usr/src/homeassistant/homeassistant/components/shelly/__init__.py", line 168, in _async_block_device_setup
    shelly_entry_data.block.async_setup()
  File "/usr/src/homeassistant/homeassistant/components/shelly/coordinator.py", line 338, in async_setup
    super().async_setup()
  File "/usr/src/homeassistant/homeassistant/components/shelly/coordinator.py", line 139, in async_setup
    hw_version=f"gen{self.entry.data[CONF_GEN]} ({self.model})",
                     ~~~~~~~~~~~~~~~^^^^^^^^^^
KeyError: 'gen'

I have 2 shelly 2.5 and one Shelly EM on latest firmware. All do not work now.

Same problem here ...

@g1za
Copy link

g1za commented Jan 5, 2024

Here as well (Shelly 2.5)
`Logger: homeassistant.config_entries
Source: config_entries.py:406
First occurred: 18:34:15 (8 occurrences)
Last logged: 18:38:08

Error setting up entry Tapparella studio for shelly
Error setting up entry Tapparella camera for shelly
Error setting up entry Tapparella bagno for shelly
Error setting up entry Tapparella soggiorno for shelly
Error setting up entry Irrigazione for shelly

Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/config_entries.py", line 406, in async_setup
result = await component.async_setup_entry(hass, self)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/components/shelly/init.py", line 131, in async_setup_entry
return await _async_setup_block_entry(hass, entry)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/components/shelly/init.py", line 201, in _async_setup_block_entry
await _async_block_device_setup()
File "/usr/src/homeassistant/homeassistant/components/shelly/init.py", line 168, in _async_block_device_setup
shelly_entry_data.block.async_setup()
File "/usr/src/homeassistant/homeassistant/components/shelly/coordinator.py", line 338, in async_setup
super().async_setup()
File "/usr/src/homeassistant/homeassistant/components/shelly/coordinator.py", line 139, in async_setup
hw_version=f"gen{self.entry.data[CONF_GEN]} ({self.model})",
~~~~~~~~~~~~~~~^^^^^^^^^^
KeyError: 'gen'`

Logger: homeassistant.components.shelly Source: helpers/update_coordinator.py:332 Integration: Shelly (documentation, issues) First occurred: 18:37:42 (3 occurrences) Last logged: 18:38:27 Error fetching Tapparella studio data: Error fetching data: DeviceConnectionError()

@jduro
Copy link

jduro commented Jan 5, 2024

Any log? Just upgraded from 2023.12.3 to 2024.1.1 and the integration does not load anymore. Got these logs:

Logger: homeassistant.config_entries
Source: config_entries.py:406
First occurred: 19:11:52 (3 occurrences)
Last logged: 19:11:52

Error setting up entry Volet roulant Cuisine for shelly
Error setting up entry Shelly EM E4550e for shelly
Error setting up entry Volet roulant Salon for shelly
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/config_entries.py", line 406, in async_setup
    result = await component.async_setup_entry(hass, self)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/shelly/__init__.py", line 131, in async_setup_entry
    return await _async_setup_block_entry(hass, entry)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/shelly/__init__.py", line 201, in _async_setup_block_entry
    await _async_block_device_setup()
  File "/usr/src/homeassistant/homeassistant/components/shelly/__init__.py", line 168, in _async_block_device_setup
    shelly_entry_data.block.async_setup()
  File "/usr/src/homeassistant/homeassistant/components/shelly/coordinator.py", line 338, in async_setup
    super().async_setup()
  File "/usr/src/homeassistant/homeassistant/components/shelly/coordinator.py", line 139, in async_setup
    hw_version=f"gen{self.entry.data[CONF_GEN]} ({self.model})",
                     ~~~~~~~~~~~~~~~^^^^^^^^^^
KeyError: 'gen'

I have 2 shelly 2.5 and one Shelly EM on latest firmware. All do not work now.

Same problem here, downgraded to 2024.1.0

@thecode
Copy link
Member

thecode commented Jan 5, 2024

Thanks, no need for additional "same problem", logs shows the problem, working on a fix

@lobolobo
Copy link

lobolobo commented Jan 5, 2024

Thanks, no need for additional "same problem", logs shows the problem, working on a fix

@thecode, thanks for the info.

@guillempages
Copy link
Contributor

If this helps, in my case only some of my Shelly 2.5 are having this issue, but others work normally. All of them are on the same FW, and I could not see any differences in the (on-device) configuration.

@thecode
Copy link
Member

thecode commented Jan 5, 2024

If this helps, in my case only some of my Shelly 2.5 are having this issue, but others work normally. All of them are on the same FW, and I could not see any differences in the (on-device) configuration.

Yes, if the device was added after we introduced support for Gen2 (although it is Gen1) it will work since we store the Gen.
The issue is due to a missing Gen value for older devices.

@micium
Copy link

micium commented Jan 5, 2024

The shelly integration didn't have a good start to the new year, first problem with the shelly 2nd gen powered on battery (like shelly smoke), after the 2024.1.1 patch .. total disaster, I restored the 2012.12.4 backup and everything works fine. I hope for a resolution soon since I have more than 30 shellies installed.

@g1za
Copy link

g1za commented Jan 5, 2024

If this helps, in my case only some of my Shelly 2.5 are having this issue, but others work normally. All of them are on the same FW, and I could not see any differences in the (on-device) configuration.

Yes, if the device was added after we introduced support for Gen2 (although it is Gen1) it will work since we store the Gen. The issue is due to a missing Gen value for older devices.

If needed, as a quick workaround, I would be open to manually update some files, if possible, to add the 'gen' value before the next release (but also to align to the current approach those devices added before the support for Gen2 was introduced).

@johndoe0815
Copy link

Will it work again with the pull request after updating from 2024.1 to the next 2024.2 or is this gen lost and can't be recovered?

@salvisbh
Copy link

salvisbh commented Jan 5, 2024

I don't know if it helps to solve the problem: With 2024.1.0 a Shelly 2.5 was no longer loaded with a log entry that the firmware version was too old. In reality, the version was too new, I had installed the latest beta of Shelly. After a downgrade to the official Shelly version, the Shelly 2.5 was recognized correctly. I then installed 2024.1.1 with the result that my Shelly 1PM is no longer detected. In my opinion, these also run with a beta firmware 20230913-113709/v1.14.0-gcb84623

@g1za
Copy link

g1za commented Jan 5, 2024

Don't worry guys, the PR above is being approved and is almost there to fix the problem. ;)
These are things that sometimes happen but be confident in the development team!

@anpak
Copy link

anpak commented Jan 5, 2024

Don't worry guys, the PR above is being approved and is almost there to fix the problem. ;) These are things that sometimes happen but be confident in the development team!

Thank you! How long the PR takes? Have I to downgrade my Home Assistant or should I wait for the new HA version?

@matthewharrington
Copy link

I downgraded which was easy. There isn't anything in 2024.1.1 that is required for functionality

@starkillerOG
Copy link
Contributor

The PR will be included in HA 2024.1.2 which is currently scheduled for Jan 12th, but this could always be a bit earlier or later.

If you want to solve it now, you can downgrade back to HA 2024.1.0 and wait for HA 2024.1.2 to be ready.

Or stay on HA 2024.1.1, remove the shelly integration, restart HomeAssistant, setup the shelly integration again. This will add the missing key in your configuration data and it schould work again. BE WARNED: this will reset the device and entity names and entity IDs, therefore you will need to set those back otherwise your automations may not work anymore.

@bieniu
Copy link
Member

bieniu commented Jan 5, 2024

I apologise to everyone for this issue, it's my stupid mistake. Thanks to @thecode for the quick fix.

@b3nj1
Copy link
Contributor

b3nj1 commented Jan 5, 2024

If you are impatient and don't what to remove/add-back the device or go back to an older HA version, this worked for me. Using the SSH add-on, use the editor of your choice to add , "gen": 1 (don't forget the comma) to the device's corresponding data section in /root/config/.storage/core.config_entries, and restart HA.

Eg,

      {
        "entry_id": "b2ad817589a24c3ec816f0a8c1418da1",
        "version": 1,
        "minor_version": 1,
        "domain": "shelly",
        "title": "shellyswitch25-E8DB84A20CCA",
        "data": {
          "host": "10.0.1.59",
          "sleep_period": 0,
          "model": "SHSW-25",
          "gen": 1
        },
        "options": {},
        "pref_disable_new_entities": false,
        "pref_disable_polling": false,
        "source": "zeroconf",
        "unique_id": "E8DB84A20CCA",
        "disabled_by": null
      },

@g1za
Copy link

g1za commented Jan 6, 2024

use the editor of your choice to add , "gen": 1 (don't forget the comma) to the device's corresponding data section in /root/config/.storage/core.config_entries, and restart HA.

Eg,

      {
        "entry_id": "b2ad817589a24c3ec816f0a8c1418da1",
        "version": 1,
        "minor_version": 1,
        "domain": "shelly",
        "title": "shellyswitch25-E8DB84A20CCA",
        "data": {
          "host": "10.0.1.59",
          "sleep_period": 0,
          "model": "SHSW-25",
          "gen": 1
        }

Thanks a lot; this is exactly what I was looking for.
It worked for me as well and now I am on 2024.1.1
Cheers!

@doronazl
Copy link

doronazl commented Jan 6, 2024

same here, had to remove and re-add the device.

@micium
Copy link

micium commented Jan 6, 2024

If you are impatient and don't what to remove/add-back the device or go back to an older HA version, this worked for me. Using the SSH add-on, use the editor of your choice to add , "gen": 1 (don't forget the comma) to the device's corresponding data section in /root/config/.storage/core.config_entries, and restart HA.

Eg,

      {
        "entry_id": "b2ad817589a24c3ec816f0a8c1418da1",
        "version": 1,
        "minor_version": 1,
        "domain": "shelly",
        "title": "shellyswitch25-E8DB84A20CCA",
        "data": {
          "host": "10.0.1.59",
          "sleep_period": 0,
          "model": "SHSW-25",
          "gen": 1
        },
        "options": {},
        "pref_disable_new_entities": false,
        "pref_disable_polling": false,
        "source": "zeroconf",
        "unique_id": "E8DB84A20CCA",
        "disabled_by": null
      },

Thanks a lot !! Can I add the "gen" key before the update to 2024.1.1 ?

@mbo18
Copy link
Contributor

mbo18 commented Jan 6, 2024

Thanks a lot !! Can I add the "gen" key before the update to 2024.1.1 ?

Yes

@Diegocampy
Copy link

Only for infor other people, in my case, with update to 2024.1.1 all Shelly work fine in Shelly App, and in Home Assistant:

  • Shelly 1
  • Shelly Air
  • Shelly Plus 1 PM
  • Shelly 1 PM
  • Shelly EM3
  • Shelly Bulb 1
    Don't ask me the reason, I have only update Home assistant 🤷🏻‍♂️

@xpdm
Copy link

xpdm commented Jan 6, 2024

see breakchange: https://www.home-assistant.io/blog/2024/01/03/release-20241/

"Shelly
The minimum supported firmware version for generation 1 devices is 1.11.0 (2021-07-15). The minimum supported firmware version for generation 2 devices is 1.0.0 (2023-08-03).

You must update your devices to the firmware versions listed or newer.

(@bieniu - #105384) (documentation)"

@micium
Copy link

micium commented Jan 6, 2024

Thanks a lot !! Can I add the "gen" key before the update to 2024.1.1 ?

Yes

It worked for me as well and now I am on 2024.1.1
Cheers!

@DataBitz
Copy link
Contributor

DataBitz commented Jan 6, 2024

Only for infor other people, in my case, with update to 2024.1.1 all Shelly work fine in Shelly App, and in Home Assistant:

  • Shelly 1
  • Shelly Air
  • Shelly Plus 1 PM
  • Shelly 1 PM
  • Shelly EM3
  • Shelly Bulb 1
    Don't ask me the reason, I have only update Home assistant 🤷🏻‍♂️

Shelly Dimmer 2 were affected for me, but the workaround from @mclem fixed them.

@CamFlyerCH
Copy link

I confirm fixed with 2024.1.2 ! Thanks a lot for the quick fix ! It affected 4 of my 7 Shelly devices including also a 3EM.

@fredtj
Copy link

fredtj commented Jan 6, 2024

isn't fixed for me, i see the below. do you want a new bug report?

home-assistant            | Traceback (most recent call last):
home-assistant            |   File "/usr/local/lib/python3.11/site-packages/aioshelly/block_device/device.py", line 184, in _async_init
home-assistant            |     await self.initialize(True)
home-assistant            |   File "/usr/local/lib/python3.11/site-packages/aioshelly/block_device/device.py", line 123, in initialize
home-assistant            |     self._shelly = await get_info(
home-assistant            |                    ^^^^^^^^^^^^^^^
home-assistant            |   File "/usr/local/lib/python3.11/site-packages/aioshelly/common.py", line 103, in get_info
home-assistant            |     raise fw_error
home-assistant            | aioshelly.exceptions.FirmwareUnsupported: {'type': 'SHHT-1', 'mac': '44179321DC27', 'auth': False, 'fw': '20210710-130145/v1.11.0-g12a9327-master', 'sleep_mode': True}```

@thecode
Copy link
Member

thecode commented Jan 6, 2024

@fredtj as a general approach you should avoid commenting on a closed issue (as some developers stop following it when it is closed) and create a new issue, this specific case is a different issue anyhow.

btw, I checked with the core team they are not charged per issue 😄

@github-actions github-actions bot locked and limited conversation to collaborators Feb 6, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.