Shelly4hass and native Shelly integration

Thing is Tom that S4H uses the same domain, shelly, which is the same as the native integration. Sure you can remove S4H and then in your own pace add them one by one back to native Shelly but as you understand you will loose the devices in the mean time. On top off that you will loose all long term stats including energy data.

Moving from S4H is not trivial at all if you require all data to be kept. This solution does not automate any of the steps no, but it heavily reduces the risk of data loss and continuous labour. If I would do all of this in one go I know I have to complete it at the same session as I start it. This method removes that obstacle as well.

Unfortunately this did not go as planned. I cannot find a way to delete devices or even entities provided by S4H. Since I cannot delete them on the fly I cannot give the new entities from the official integration the same ID.

Have you managed to successfully migrated and kept LTS and Energy data?

After updating to HA 2024.12.0b3 all my shelly4hass devices are unavailable.

1 Like

Long term statistics are not deleted just like that. You are either missing devices with the same entity_ids or those devices have now different entity_ids:

  1. Add new device with that same entity_id and LTS will reappear.
  2. Change entity_ids of sensors back (from before integration switch) and LTS will reappear.

:wink:

i changed all the shelly to shelly4h after rebooting in save mode - seems like it worked. Not so easy to put the vm data partition in a sd card slot :wink:

Spook is very helpful to find all sorts of things with missing entities (after renaming or similar)

So can anyone who has actually done this give any clarification.

The method above allows both to exist, but as above you can have two entities with the same ID and you cant delete an entity in shelly for hass - so whilst it is nice in one way it does not solve the probiem.

I have 80 devives and 80 automations. It runs my house.

I have just delete Shelly for hass and add the shelly native integration then does anyone know what happens? Do the devices have the same names and entity IDs in the native integation so all is well or do i have to rename them all ( bear in mind shelly call them something like “getr35904359fe39f” which was dealt with at the time they were added and renamed , but now i will have 80 random entities to identify and then goto to 80 automations and hop i can figure it out.

Since the native shelly integration is a completly different product, it does scanning and naming of the shellys completely different. So the entity names are not the same. Migration is not automated.

So the " process " is delete shelly for hass , enable the native integration and then sort out the considerable mess in every automation and script ?

When they new devices join do they pick up the Shelly name or just the id ? Ie " 8593jfj884" as an id or " lounge dimmer "

At least the latter makes some sense and then I " just" have to work through every script and automation.

If you first delete shelly4hass, everything stops working and it is very difficult to migrate. If you run shelly4hass and native shelly in parallel, you can migrate one device every day until you are finished.
The entity names of the native shelly integration are like that: “sensor.shellyplug_s_ab913b_energy” when the mac address is “xx:xx:xx:AB:91:3B”

hi

thank you.

I am trying to follow your first post but I dont have access to the following directories

I do not have the “.” directories.

The lowest level that I have and my ( non dot) Home Assistant directories are attached.

I was also trying to folly remove Shelly4hass earlier ( I am running a second test machine) but had the same issue that it requires accessing the “.” directories.

Can you please let me know how i can access this ?

When trying to remove shelly4hass i remover manually all of its files but that was not good enough to enable the native integration .

Thank you for your help

Jeremy

  • in .homeassistant/.storage/core.config_entries:“domain”: “shelly4h”,
    and
    “title”: “Shelly4hass”,
  • in .homeassistant/.storage/core.device_registry:
    “identifiers”: [[“shelly4h”,…]]
  • in .homeassistant/.storage/core.entity_registry:
    “platform”:“shelly4”
  • in configuration.yaml:
    shelly: → shelly4h: (if you have that)

Screenshots and also the File Editor config - that allows me to look beyond just the config file.



just making sure it should be shelly4 and not shelly4h?

Huuu…you are right! What an terrible bug! I changed it to shelly4h. Thank you!

I don’t know where your “.storage” is.
Try to activate “Directories first”.

np

i am trying to migrate my shelly4hass to native integration
after doing all the changes
indeed i can see 2 shelly integrations

however i seems my old shelly entities exist but no longer available
and now i got new entities with default shelly names such as (switch.shelly_XXX before it was switch.parents_room_main_light)

so now i have both
switch.shell_XXX (working)
and
switch.parents_room_main_light (unavailable )

any ideas why this might happen?

note that when i added the shellys devices back in the day i did change the entity ids to meaningful names such as switch.parents_room_main_light

thanks

I dont seem to be winning. Glad I am doing this on a second machine!

I did mange to get into the “.” directories.

I followed the instructions other than " * shut down homeassistant" as if i do that i cant use file editor!

I had errors ( shelly failed to start) on restart and it said click here to correct this error which proimptly deleted Shelly 4 Hass.

How can I shut down HA and still edit using File Editor please?

I assume that HA will auto discover the shelly devices once the shelly for hass has actually gone ?

Any guidance re the above appreciated. I am not an HA genius but by following instructions 99% of stuff works out but not this time!

If HA is still running, it will overwrite your changes. I will not work. You have to edit the files without HA running. How to do this depends on your configuration and installation method.

Interesting ! Givne the unti is on then HA will be running , and I would have no idea how to edit the files other than via file editor!

Given this is a total show stopper I have to find a way to do this so if anyone who has done it can tell me how i can edit the files but not have the system running I would appreciate it

I miss one feature from shelly4hass that is not in the HA integration. Shelly4hass can listen to double click on the shelly dimmer, and the HA integration cannot do this. Anyone know a workaround I can do in the HA integration do get double press working?