Shellies Discovery Script

I have recently added this script (4 dimmer2 devices) and the gen2 script for a bunch of plus devices. I think I have things working finally (I’m still pretty new so please forgive if I use the wrong terms).

I would like to be able to access my dimmer input 1 and input 0 as sensors, not just short/long press button 0 and button 1 events. I see them listed as “unavailable”. Is there a way to enable these as sensors using the integration?

Events are available by… the events entities and as the device automation triggers. Input sensor should be used only if your connected input is a switch, not button. Input entities are not unavailable, they are disabled by default and you need to enable them in the entity settings.

Yes my inputs are switches and being used in a somewhat unusual way, I think. I

I didn’t realize until you mentioned this that you could manually enable disabled entities from the GUI. Thanks, appears to be working now,

1 Like

This thread is related to Gen1 script.

1 Like

Thanks for the great script.
I don’t know if the question is correct here. The connection to a shelly button works great. But I don’t see any entities for shortpress, longpress, etc.
how can I best configure this to use the 4 actions?

Look once again :grinning:

1 Like

Ok. Thanks
do you have any idea how I can define all 4 event_types with one automation?

You can use a choose action. If I remember correctly there is an example with choose in the event documentation (I mean HA documentation).

Having the same message over here in the log… Anything I can do to fix them?

  • modifiying the shellies_discovery automation in any way to set entity id to custom value or null or set object id

see MQTT - Home Assistant and Entity | Home Assistant Developer Docs

In Addition to the message MQTT entity name starts with the device name in your config, would it be possible to set define the channel names from within the automation script, instead of using the default ones?
i.e. my configuration

      shelly1-E8DB84Dxxxxx:
        device_name: Shelly Flur
        relay-0: light
        relay-0-name: Flur

creates a device Shelly Flur :heavy_check_mark: containing the entity id light.shelly_flur_flur :question:
According to MQTT - Home Assistant this makes sense.

The example below shows how to publish a temperature sensor ‘Bathroom Temperature’. The device_class is set, so it is not needed to set the “name” option. The entity will inherit the name from the device_class set and also support translations. If you set “name” in the payload the entity name will start with the device name.

However it would be great to manipulate or defince the entity id as well, to receive the light.flur instead.
Could we somehow make use ob tje object id, when devices and entities are published from the discovery script ?

      shelly1-E8DB84Dxxxxx:
        device_name: Shelly Flur
        relay-0: light
        #relay-0-name: Flur

creates the entity name: light.shelly_flur_relay_0

@Bieniu are you involved in the core integration over CoIoT?
What are the pros/cons/differences in MQTT vs CoIoT?

I could write a book answering your question :joy: Much depends on your requirements.

The primary difference is that the integration uses CoIoT (UDP) and the script uses MQTT. For example, with CoIoT you may have problems if the devices are on a different subnet than the HA server.

2 Likes

Is this working with ?
https://www.shelly.com/en/products/shop/shelly-pm-mini-gen-3

No, you have to use Shellies Discovery Gen2 GitHub - bieniu/ha-shellies-discovery-gen2: Script that adds MQTT discovery support for Shellies Gen2 devices

Guys I need help because I’m pulling some of the lasts hair that I have!
I’m trying to follow the installation instruction and I’ve enabled python scripts, I’ve downloaded the 2 scripts with HACS, but now the instruction says:

After installing the script and adding automations

Which automation?

Those automations

Oh, I see.
May I suggest to write in the installation section to put the automation code (that just below) in the configuration file and then run the automation?
Thanks for our job!

1 Like

It’s working, but a switch2.5 (I have only one) has not been found.
I’ve installed the gen2 script too (even though I think that it’s still gen1), the announce automation doesn’t trigger the discovery (while the gen1 does).
What could I check?
Thanks!

PR is most welcome.

1 Like

This thread is dedicated to gen1 script and devices.

“Troubleshooting checklist” section in the documentation.