Shellies Discovery Script

You’re awesome! Appreciate the continued support on this project, i have a coffee headed your way.

1 Like

Have I been using this script correctly?

Am I still supposed to use this WITH the Shelly core integration? I have just been using the script itself all the entities just appear when I search for shelly. Kinda messy, but its worked.

@nappyjim Shelly core integration uses CoAP to communicate with devices, this script creates configuration for MQTT integration (MQTT is using to communicate). So you don’t have to use the core integration if you use the script.

Thats where I am getting confused. I am still using the script but then because I was having another issue (described below), I went and added the Shelly integration. It found my devices but then when I click on a device, it shows MQTT up in the right hand corner. So I figured the integration was using MQTT as well now, maybe because of the scirpt…I dunno.

My issue I was trying to resolve:
I have a magnetic reed switch connected to a Shelly1. Used to determine if garage is open or closed. When its ON garage is closed, when its OFF garage is open. But when I choose the binary sensor entity and set it to ‘Show as’ a garage door, it shows OPEN when its ON. But I need it to show OPEN when its off. Can this be changed in the script? (I have a template cover that I used and that shows correct, I am just trying to get the actual binary sensor entity to match as well.)

The script doesn’t change the state sent by the device. You have to change the behavior in the device configuration.

Hi i run into the following error
Using HA 2022.7.7
script version 0.45
Using Shelly Plug S with the latest firmware

Logger: homeassistant.components.python_script.shellies_discovery.py
Source: components/python_script/init.py:224
Integration: Python Scripts (documentation, issues)
First occurred: 15:39:11 (18 occurrences)
Last logged: 16:33:41

Error executing script: model_id value None is not valid, check script configuration

Traceback (most recent call last): File “/usr/src/homeassistant/homeassistant/components/python_script/init.py”, line 224, in execute exec(compiled.code, restricted_globals) File “shellies_discovery.py”, line 1629, in ValueError: model_id value None is not valid, check script configuration

@LeoArnts Literally “check the script configuration” because it is not up to date.

It was the firmware of the Shelly plug s :frowning: its working thanks

Someone have problem with HA 202209-0? I have lost all shellies by MQTT… :slightly_frowning_face:

What do you mean lost?

Probably this bug
https://pullanswer.com/questions/bug-light-unavailable-after-2022-9-0-upadate

What this has to do with Shellies Discovery?

All devices are unavaliable. But MQTT detects the messages and these are correct. In fact, by defining the entities individually, they are perfectly functional

Now I downgrade HA and all functionaly are OK

It seems solved in 2022-9-1.
Tanks

I did nothing, your problem is/was related to ShellyForHass, not to Shellies Discovery.

I use Shellies Discovery

So I don’t understand your problem.

I’ve been using this script for a long time but since we’re having a native support for Shelly stuff in HA I was think about migrating off of it. Nothing wrong with the script, awesome job @Bieniu. I just try to use as little HACS stuff as possible.

Anyone went that road? Can I just remove the integration from HACS? Do I have to change anything in configuration? What is the of-boarding route for this?

  • disable MQTT on the device webpanel
  • configure unicast for CoIoT on the device webpanel
  • remove the device from HA
  • check if config topics have removed from MQTT broker (if not, you have to remove them yourself) obraz
  • restart HA
  • configure the device with core integration