Shellies Discovery Script

There is an official Shelly integration in HA (with discovery) but it uses CoAP, not MQTT, and I’m co-codeowner of it. There is a plan that this integration will also use MQTT.

Is there any ETA when Shelly with MQTT will be supported without a need to run scripts etc?
Everything works fine via IP, however sensor like H&T do not update values (or they do once per a very long period), so using MQTT is a must in this case.

No, we’re now working on adding support for battery powered devices via CoAP.

Perfect, will it update the temperature with the same frequency as to the shelly cloud? Can I participate in alpha/beta stage somehow?

State will be update when the dewice send CoAP multicast.

This change is not ready and still requires a lot of work

Hello,

I am uncertain if this is the right place to post this question to, please advise if it is not.
I have a Shelly i3 hooked up to an automation to toggle some lights (deconz) by setting a device trigger to Shelly i3 homeassistant/shellyi3_01 Shortpush 0 turned on.
This causes the light to toggle every 30 seconds. Having a look with mosquitto, I see the input_event {“event”:“S”,“event_cnt”:107} flashing there every 30 seconds, but the event_cnt not changing.
I am seeing the same for all my Shellies apart from the Shelly Button (even when hooked up to USB power). Is this expected behaviour?

Thanks,
Pete

IMO this is Shelly firmware issue. I can’t do anything about it. As a workaround you can change mqtt_update_period to 0.

curl http://<DEVICE_IP>/settings?mqtt_update_period=0

Hello,

Shellies Discovery Script don’t discover the Shelly Button 1, i have this error, but the Firmware dated 20201124 is the last firmware for this device (1.9.0).

Logger: homeassistant.components.python_script.shellies_discovery.py
Source: components/python_script/init.py:217
Integration: Python Scripts (documentation, issues)
First occurred: 2:02:22 (3 occurrences)
Last logged: 2:03:17

Error executing script: Firmware dated 20201124 is required, please update your device shellybutton1-XXXXA8ACA1A3

Traceback (most recent call last): File “/usr/src/homeassistant/homeassistant/components/python_script/init.py”, line 217, in execute exec(compiled.code, restricted_globals) File “shellies_discovery.py”, line 499, in ValueError: Firmware dated 20201124 is required, please update your device shellybutton1-XXXXA8ACA1A3

Have a look a few posts up. You need to update the button manually. I had the same prob. Updating helped.

Yes, i look the post, but the update button don’t resolve the problem for me…

You have to check which version of Button1 you have: curl http://<deviceIP>/shelly
If SHBTN-1 use:
curl http://<deviceIP>/ota?url=http://repo.shelly.cloud/firmware/SHBTN-1.zip
if SHBTN-2 use:
curl http://<deviceIP>/ota?url=http://repo.shelly.cloud/firmware/SHBTN-2.zip

Thanks for all, After update it’s ok :+1:

Hello,

I am trying to read the status of the input entity on some shelly2.5 in roller mode. I have noticed that input entities on roller mode are not created and they don’t exist for the device (They actually do when shelly2.5 is configured in relay mode). Is this intended? There seems to be mqtt messages for inputs on/off when in roller mode.

To add more to my confusion, I have tried to add the shellies using the official integration just to see if I could access the input data there but, in that case, no input entities are created when in relay mode. They are created when roller mode but they do not seem to be updated when pressing the physical buttons (i have them configured as momentary buttons) :?

@Bieniu, can you shed some light on the rationale behind input entities? Thanks!

Show me topics and payloads and I’ll add the input sensor.

This thread is not related to native Shelly integration.

Thanks for looking into it.

As far as I know they are the same as the ones in relay mode. This is what mosquitto_sub reports in my case when I push the down button (configured as momentary):

shellies/shellyswitch25-73CB79/input/0 1
shellies/shellyswitch25-73CB79/roller/0 close
shellies/shellyswitch25-73CB79/roller/0/pos 0
...
shellies/shellyswitch25-73CB79/input/0 0

And similar to the up button:

shellies/shellyswitch25-73CB79/input/1 1
shellies/shellyswitch25-73CB79/roller/0 open
shellies/shellyswitch25-73CB79/roller/0/pos 0
...
shellies/shellyswitch25-73CB79/input/1 0

Yep sorry. Is there an “official” thread like this one that I can follow? I would like to be up to date with current official integration so I know if I have to make the switch from mqtt to official. Basically, right now I am in the position that: “I will switch when @Bieniu switches” as I’ve read that you still use the mqtt integration personally… :sweat_smile: :wink:

1 Like

I don’t know. If you open a new thread I’ll follow it and help with problems.

Personally, I think that MQTT is more stable and reliable than CoAP, so on my production HA I don’t intend to change to native integration until it supports MQTT. When it will be? Hard to say.

Does device send longpush topic in roller mode?

No. I don’t really know why not but at least in my tests with latest shelly firmware (1.9.3) it only sends longpush in relay mode. Also it only sends input_events on relay mode not roller. :thinking:

Hello Maciek

great work! Had some problems first, my mqtt-prefix didn’t work because of the slashes (floor/room/device). But now alle Shellies are detected.

But now I’ve got a problem with the shelly 2.5s. They are all added as relay, but most of them are rollers. How can I change that?

Kind regards
Rob

Please read the docs.