How exactly are shelly integrations related?

Summary:

I do not understand how and where the native and HACS-installed (ShellyForHASS) interact.

Background

I was planning to motorize my roller shitters and bought a few months ago, in advance, several Shelly 2.5 devices. I did not have the motorization at that time yet so I set them up “in the void”: I integrated them to my HA (apparently via the HACS-installed integration (see later why this matters)) and measured whether there was appropriate tension on appropriate PINs when “moving the shutters”. It worked and the shellies were left along awaiting for the motorization.

The motorization came and the shellies worked as expected for two or three weeks. I then upgraded their firmware and HACS warned me that I have new versions of some integrations (which, I think, included ShellyForHACS) and I started to see in the logs an error.

I opened a GitHub Issue for the native shelly integration (because I forgot that I used ShellyForHASS) and was told that the issue is with ShellyForHACS (and then @thecode kindly told me how to switch to the native integration).

What I did and what I do not understand

So I uninstalled the ShellyForHACS integration, which was visible in the integration panel as

image

I rebooted HA. There was no more ShellyForHASS integration in the HASS integration window.

I then added the (what I assume to be) the native shelly integration. To my surprise, the logo on the integration page is still the same. The options for that integration are also the same as before (the ones I had with ShellyForHASS). This is a bit surprising.

The integration found my devices, with generic names. Unfortunately, I started to get another error, this time specifically from the native integration:

2020-12-02 09:26:23 ERROR (MainThread) [homeassistant.config_entries] Error setting up entry shelly for shelly
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/config_entries.py", line 236, in async_setup
    result = await component.async_setup_entry(hass, self)  # type: ignore
  File "/usr/src/homeassistant/homeassistant/components/shelly/__init__.py", line 64, in async_setup_entry
    ip_address = await hass.async_add_executor_job(gethostbyname, entry.data[CONF_HOST])
KeyError: 'host'

Crap, I told myself in French and, on a whim, I just reinstalled via HACS the ShellyForHASS integration from HACS (just installed it, nothing more) and the error above is gone (the one from the GitHub Issue is not there either - which is kind of understandable as I do not use it per se).

My questions

  • should the integration logos on the integration page for the native integration and ShellyForHASS be the same?
  • is there some kind of relationship between the two integrations above?
  • if ShellyForHASS is installed, should I see two possible integrations for shelly on the integration page?

As of now the shutters work fine so this is more to understand the integrations than to fix a specific problem.

shellyforhacs replaces the native shelly integration. They will look the same if the dev of shellyforhacs made them look the same.

No, the custom integration fully replaces all the code for the built in integration.

No, because it replaces the other.

Thank you for the answers. How can I check whether the integration I am using is the native one, or ShellyForHACS? Is the only way:

  • to have ShellyForHACS installed, reboot and then the integration is ShellyForHACS
  • to remove ShellyForHACS from the HACS integration page, reboot, and then I am back to the native one?

Sorry for asking the obvious because I am surprised to see one integration replacing another one (and not being offered as an alternative).

I also want to be sure I understand everything because as I had with the native integration the error in my question and reinstalled ShellyForHACS (not realizing it replaces the native one)

  • I will open an Issue for the native integration with the error in my question
  • close the issue in ShellyForHACS I opened (I did not mention it in my question to keep some kind of clarity) because the error is now magically gone

and I do not want to create entropy

The error source tells you

Notice how components says “components” and not custom_components? That’s how you know where the error is coming from.

Also, if you don’t have shelly inside custom_components folder, it’s coming from native. If you do, it’s coming from the custom.