Shellies Discovery Script

You need to update Shellies Discovery automation https://github.com/bieniu/ha-shellies-discovery/blob/firmware-1.10/README.md#minimal-configuration

ahh thought I missed something like that ā€¦ didnā€™t know I could check the readme for the unreleased version :man_facepalming:

All good now

1 Like

New version: 0.39.0

Changelog:

  • use input_event topic instead of input for device triggers BREAKING CHANGE
  • add button release device trigger
  • use input_event topic instead of input for event sensors (longpush, shortpush, etc.)
  • remove input sensor attributes BREAKING CHANGE
  • remove mode argument for RGBW2, please update script configuration BREAKING CHANGE
  • add temperature_status sensor for Shelly 1PM/2.5/i3
  • add voltage sensor for Shelly 2/2.5
  • add ignore_device_model argument

Requirements:

  • firmware 1.1.0 for Shelly Motion
  • firmware 1.6.5 for Shelly 4Pro
  • firmware 1.10 for other models
  • HA restart after announce

Version 0.39.0 works well for me. :+1:

Only the DW2 causing trouble because FW 1.10 isnt released yet:
Error executing script: Firmware dated 20210318 is required, please update your device shellydw2

Yea thx man. Iā€™ve implemented 2 scripts. Notifications and Shelly Firmware Update via HASS works well.

1 Like

I have updated to latest version without any issue (canā€™t thank you enough @Bieniu for your great job).

However, I am hit by a bug in one of my shelly EM that prevents it to upgrade its firmware to 1.10.0. Furthermore I lost my MQTT config retained messages due to the mosquitto addon update bug (murphyā€™s law at its finest).

As a result, I cannot see the shelly em with 1.9.4 firmware in home assistant and I am lossing my consumption history. Is there a temporal workaround I can use to make it work again while waiting for a fix from shelly? Maybe manually creating a config MQTT message to help the integration see the device?

Regards,

You can use older version of the script to create configuration for Shelly EM.

Went back to previous version, wait for discovery and now I am back to latest with shelly EM reporting values. Thanks!

I have noticed that now both the shelly EM (obviously) and shelly RGBW2 (seemed that it went back to firmware 1.9.0), when they report in home assistant logs that a new firmware version is needed I also get loads of ā€œNo ACK from MQTT server in 10 secondsā€ warnings. I guess that is normal until new firmware gets to those devices?

regards,

Look here Mosquitto 5.1.1 is broken. Ā· Issue #1887 Ā· home-assistant/addons Ā· GitHub

Hi guys,
I would like to display the FW version of the shellies in lovelace, but couldnā€™t find a way.
There is only a firmware update sensor, but no firmware version.
Maybe the right way would be a template sensor, but I am not very familiar with it.
Sorry if I am hijacking this thread.
Any help would be appreciated.


The firmware update binary sensor shows the installed firmware version as an old_version attribute. Use the template sensor.

1 Like

After digging a little more, I found out about two variants for displaying attributes.

  1. Using Entity card, which let you choose the attribute you want to display - not what I wanted as I have multiple shellyā€™s
  2. Using Entities card and a custom multiple-entity-row, like this:
type: entities
entities:
  - entity: binary_sensor.grijanje_hidrofora_firmware_update
    name: Grijanje hidrofora
    type: 'custom:multiple-entity-row'
    entities:
      - entity: null
        name: Trenutna verzija
        type: attribute
        attribute: old_version

Maybe this will someone found useful

Hi @Bieniu, I have a issue to intigrate new shelly rgbw2 controller. I got following error on home assistant:

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/python_script/__init__.py", line 218, in execute
    exec(compiled.code, restricted_globals)
  File "shellies_discovery.py", line 1417, in <module>
ValueError: mode value None is not valid, check script configuration

If I removed an already exiting shelly rgbw2 and try to install it again the issue cames too. Before I havenā€™t got such a problem to integrate a new shelly rgbw2 controller via your shelly discovery script. Have you any idea? Many thanks for you amazing work.

Did you read the changelog?

Small hint

1 Like

Hello, Sorry for maybe a stupid question. I tried to find the answer in this long thread but couldnā€™t find it easily.

I can see many repeating INFO logs constantly re-appearing in log coming from shelly_discovery automation. I can imagine the scenario that shelly _announce is asking Shelly devices to report and after they report Shelly_discovery automation updates their state. Is this also used to test the presence of the devices? Or maybe devices are reporting their presence independently and this is just for the discovery of new devices?

Question: Do we need to keep shellies_discovery automation turned on all the time? Or maybe we can switch automations off after all devices are found? - just to reduce recurring INFO logs?

BTW. Maybe the general recommendation about automation state off/on could be put on GitHub page? I meanā€¦ just info explaining if this is safe to turn off the automation and any risks related?

@Bieniu , thanks for the brilliant module

The announce automation is required for proper functioning of the entities. The discovery automation can be disabled, but it may be associated in the future with the incompatibility of the entities with new versions of HA or Shelly firmware. Isnā€™t it easier to properly configure logger?

Well, I was thinking about reconfiguring the logger, but I could see the log entries are coming from [homeassistant.components.mqtt.device_trigger] and I guess this is the general class of MQTT device discovery. Am I right?
Hmmmā€¦ Iā€™m a bit concerned that after switching it from INFO to WARN I can just miss some reports from other MQTT discoveries. Therfore my goal was just to reduce Shelly discovery INFO logs.

No, homeassistant.components.mqtt.device_trigger is for device automation triggers.

You can use this if you want see device triggers:

logger:
  default: warning
  logs:
    homeassistant.components.mqtt.device_trigger: info

Sorry Bieniu, I misunderstood and I was too fastā€¦:slight_smile:
So, when the INFO from device_trigger is generated?

Let me be precise on the motivation then:

  1. I have a log of Shellies in the house and therefore I can see a lot of logs appearing every hour. I guess over 80% of my logs are Shelly_Discovery entries. Searching thru the log isā€¦ hmmm annoying. I just wanted to find a workaround to disable Shelly Discovery logging. Also My Shelly set is stable and Iā€™m not adding new Shellies for months.
  2. Iā€™m a bit concerned about switching logs ...mqtt.device_trigger to WARN by default as I think I can miss some important reports from the other MQTT devices/integrations
  3. Finallyā€¦ turning the automation OFF and ON can be done simply from the UI (pushing a button) while changing log is changin a files+reloading etcā€¦

Thereforeā€¦ I just wanted to know if, in a situation like mine (stable set of the devices), temporary disabling of shelly_discovery automation is OK? Do I risk loosing anything important? In which situation I should re-enable shelly_discovery automation (Ha Update? Shelly Firmware Update? Adding new Shelly? Others?)

I think such information may be helpful also for the community :slight_smile: