Shellies Discovery Script

Please copy log to pastebin or any similar service. In the log has to be moment shellies_announce automation start.

Here is the link to my log file
Hassio Log

Check your MQTT configuration:

Data in your config entry is going to override your configuration.yaml

Check your MQTT broker log. It looks like HA doesn’t receive subscribed MQTT topics at all.

I saw a pletora of errors in the log, so I decided to uninstall Mosquitto, delete it from the integrations, and start from scratch.
After a few restarts I finally got it working without problems.
Thanks for your time and help!

1 Like

Does anyone have a Shelly Bulb and use it with HA via MQTT?

New version: 0.10.0

Changelog:

  • add support for ShellyEM

Hi Bieniu,

For the sake of keeping the standards, the unit for reactive power in ShellyEM, should be “VAR” instead of “W”.

Honestly, I didn’t check what reactive power is. :grin: I’ll fix this in the evening. Thanks for the information.

New version: 0.10.1

Changelog:

  • fix unit for reactive power sensor (ShellyEM)
  • add overpower binary sensor for Shelly RGBW2

Is it possible to integrate the motion sensor and the battery level of the shelly sense?

Script supports battery and motion sensor for Shelly Sense.

the script only detected the temperature, humidity, brightness and battery (sorry). I do not see the motion entity.

There was a small mistake in the script. Fixed. Thanks for information.

New version: 0.10.2

Changelog:

  • fix expire_after error for binary_sensors

thank you, very fast!

This is an amazing script. I can’t understand why the repo has only a few stars.

Thanks for your kind words.

Hi, I have the ShellyEM that generates these errors for both probes:

Exception in async_discover_sensor when dispatching ‘mqtt_discovery_new_sensor_mqtt’: ({‘name’: ‘ShellyEM XXXXXX Voltage 0’, ‘state_topic’: ‘shellies/shellyem-XXXXXX/emeter/0/voltage’, ‘unit_of_measurement’: ‘VAR’, ‘value_template’: ‘{{ value | float | round(1) }}’, ‘device_class’: ‘’, ‘availability_topic’: ‘shellies/shellyem-XXXXXX/online’, ‘payload_available’: ‘true’, ‘payload_not_available’: ‘false’, ‘unique_id’: ‘shellyem-B9E308-emeter-voltage-0’, ‘qos’: ‘0’, ‘device’: {‘identifiers’: [‘A4CF12XXXXXX’], ‘name’: ‘ShellyEM XXXXXX’, ‘model’: ‘ShellyEM’, ‘sw_version’: ‘20190719-094008/v1.5.0-em@6efff52d’, ‘manufacturer’: ‘Allterco Robotics’}, ‘platform’: ‘mqtt’},)

Exception in async_discover_sensor when dispatching ‘mqtt_discovery_new_sensor_mqtt’: ({‘name’: ‘ShellyEM XXXXXX Reactive_power 0’, ‘state_topic’: ‘shellies/shellyem-XXXXXX/emeter/0/reactive_power’, ‘unit_of_measurement’: ‘W’, ‘value_template’: ‘{{ value | float | round(1) }}’, ‘device_class’: ‘’, ‘availability_topic’: ‘shellies/shellyem-XXXXXX/online’, ‘payload_available’: ‘true’, ‘payload_not_available’: ‘false’, ‘unique_id’: ‘shellyem-XXXXXX-emeter-reactive_power-0’, ‘qos’: ‘0’, ‘device’: {‘identifiers’: [‘A4CF12XXXXXX’], ‘name’: ‘ShellyEM XXXXXX’, ‘model’: ‘ShellyEM’, ‘sw_version’: ‘20190719-094008/v1.5.0-em@6efff52d’, ‘manufacturer’: ‘Allterco Robotics’}, ‘platform’: ‘mqtt’},)

Only power_0 and power_1 work.
Where is the problem?

thank you

I had the same issue so I had to add the other measurements manually…
You should be able to see the other parameters using MQTT Lense or similar
Cheers
BT

@Hero80 @bruert I’m on vacation. I will try to fix this issue when I come back next week.