Shellies Discovery Script

I’m still in 0.26.1 (I see it in HACS)
I must be stupid, but I can’t find how to update.
Any advise?

Click Update button. But maybe your HA is not up to date?

This button is not available, but you are right, my HA is not up to date. I will update HA first.

I am using Shelly discovery script. Should I switch to the new Shelly Integration? What is the difference?

Official integration uses CoAP, script uses MQTT. Official integration doesn’t support battery powered devices yet. You have to decide :slight_smile:

I have 2 shellies 2.5 that i use for my rollers. But in my log file i have the following error:

2020-10-06 10:00:00 ERROR (SyncWorker_28) [homeassistant.components.python_script.shellies_discovery.py] Wrong roller class, the default value None was used
2020-10-06 10:00:01 ERROR (SyncWorker_54) [homeassistant.components.python_script.shellies_discovery.py] Wrong roller class, the default value None was used

is there a way to fix this?

1 Like

After upgrading i still have the same error:

2020-10-06 11:06:37 INFO (SyncWorker_18) [homeassistant.components.python_script] Executing shellies_discovery.py: {'id': 'shellyswitch25-10521CF159B9', 'mac': '10521CF159B9', 'fw_ver': '20200812-091015/v1.8.0@8acf41b0', 'discovery_prefix': 'homeassistant', 'qos': 2, 'shellyswitch25-10521cf159b9': {'mode': 'roller', 'roller-0-name': 'Keukendeur', 'roller-0-class': 'Keukendeur'}, 'shellyswitch25-40F52022A99C': {'mode': 'roller', 'roller-0-name': 'Eetkamerraam', 'roller-0-class': 'Eetkamerraam'}}
2020-10-06 11:06:37 DEBUG (SyncWorker_18) [homeassistant.components.python_script.shellies_discovery.py] id: shellyswitch25-10521CF159B9, mac: 10521cf159b9, fw_ver: 20200812-091015/v1.8.0@8acf41b0, model: None
2020-10-06 11:06:37 ERROR (SyncWorker_18) [homeassistant.components.python_script.shellies_discovery.py] Wrong roller class, the default value None was used
2020-10-06 11:06:37 DEBUG (SyncWorker_18) [homeassistant.components.python_script.shellies_discovery.py] Sending to MQTT broker: homeassistant/cover/shellyswitch25-10521CF159B9-roller-0/config {"name": "Keukendeur", "cmd_t": "~roller/0/command", "pos_t": "~roller/0/pos", "val_tpl": "{%if value!=-1%}{{value}}{%endif%}", "set_pos_t": "~roller/0/command/pos", "pl_open": "open", "pl_cls": "close", "pl_stop": "stop", "opt": "false", "avty_t": "~online", "pl_avail": "true", "pl_not_avail": "false", "uniq_id": "shellyswitch25-10521cf159b9-roller-0", "qos": 2, "dev": {"ids": ["10521cf159b9"], "name": "Shelly 2.5 10521CF159B9", "mdl": "Shelly 2.5", "sw": "20200812-091015/v1.8.0@8acf41b0", "mf": "Allterco Robotics"}, "~": "shellies/shellyswitch25-10521CF159B9/"}
2020-10-06 11:06:37 DEBUG (SyncWorker_18) [homeassistant.components.python_script.shellies_discovery.py] Sending to MQTT broker: homeassistant/switch/shellyswitch25-10521CF159B9-relay-0/config 
2020-10-06 11:06:37 DEBUG (SyncWorker_18) [homeassistant.components.python_script.shellies_discovery.py] Sending to MQTT broker: homeassistant/light/shellyswitch25-10521CF159B9-relay-0/config 
2020-10-06 11:06:37 DEBUG (SyncWorker_18) [homeassistant.components.python_script.shellies_discovery.py] Sending to MQTT broker: homeassistant/fan/shellyswitch25-10521CF159B9-relay-0/config 
2020-10-06 11:06:37 DEBUG (SyncWorker_18) [homeassistant.components.python_script.shellies_discovery.py] Sending to MQTT broker: homeassistant/sensor/shellyswitch25-10521CF159B9-power-0/config 
2020-10-06 11:06:37 DEBUG (SyncWorker_18) [homeassistant.components.python_script.shellies_discovery.py] Sending to MQTT broker: homeassistant/sensor/shellyswitch25-10521CF159B9-energy-0/config 
2020-10-06 11:06:37 DEBUG (SyncWorker_18) [homeassistant.components.python_script.shellies_discovery.py] Sending to MQTT broker: homeassistant/binary_sensor/shellyswitch25-10521CF159B9-input-0/config 
2020-10-06 11:06:37 DEBUG (SyncWorker_18) [homeassistant.components.python_script.shellies_discovery.py] Sending to MQTT broker: homeassistant/binary_sensor/shellyswitch25-10521CF159B9-longpush-0/config 
2020-10-06 11:06:37 DEBUG (SyncWorker_18) [homeassistant.components.python_script.shellies_discovery.py] Sending to MQTT broker: homeassistant/binary_sensor/shellyswitch25-10521CF159B9-shortpush-0/config 
2020-10-06 11:06:37 DEBUG (SyncWorker_18) [homeassistant.components.python_script.shellies_discovery.py] Sending to MQTT broker: homeassistant/binary_sensor/shellyswitch25-10521CF159B9-overpower-0/config 
2020-10-06 11:06:37 DEBUG (SyncWorker_18) [homeassistant.components.python_script.shellies_discovery.py] Sending to MQTT broker: homeassistant/switch/shellyswitch25-10521CF159B9-relay-1/config 
2020-10-06 11:06:37 DEBUG (SyncWorker_18) [homeassistant.components.python_script.shellies_discovery.py] Sending to MQTT broker: homeassistant/light/shellyswitch25-10521CF159B9-relay-1/config 
2020-10-06 11:06:38 DEBUG (SyncWorker_18) [homeassistant.components.python_script.shellies_discovery.py] Sending to MQTT broker: homeassistant/fan/shellyswitch25-10521CF159B9-relay-1/config 
2020-10-06 11:06:38 DEBUG (SyncWorker_18) [homeassistant.components.python_script.shellies_discovery.py] Sending to MQTT broker: homeassistant/sensor/shellyswitch25-10521CF159B9-power/config {"name": "Shelly 2.5 10521CF159B9 Power", "stat_t": "~relay/power", "unit_of_meas": "W", "val_tpl": "{{value|float|round(1)}}", "dev_cla": "power", "avty_t": "~online", "pl_avail": "true", "pl_not_avail": "false", "frc_upd": "False", "uniq_id": "shellyswitch25-10521cf159b9-relay-power", "qos": 2, "dev": {"ids": ["10521cf159b9"], "name": "Shelly 2.5 10521CF159B9", "mdl": "Shelly 2.5", "sw": "20200812-091015/v1.8.0@8acf41b0", "mf": "Allterco Robotics"}, "~": "shellies/shellyswitch25-10521CF159B9/"}
2020-10-06 11:06:38 DEBUG (SyncWorker_18) [homeassistant.components.python_script.shellies_discovery.py] Sending to MQTT broker: homeassistant/sensor/shellyswitch25-10521CF159B9-energy/config {"name": "Shelly 2.5 10521CF159B9 Energy", "stat_t": "~relay/energy", "unit_of_meas": "kWh", "val_tpl": "{{(value|float/60/1000)|round(2)}}", "dev_cla": "energy", "avty_t": "~online", "pl_avail": "true", "pl_not_avail": "false", "frc_upd": "False", "uniq_id": "shellyswitch25-10521cf159b9-relay-energy", "qos": 2, "dev": {"ids": ["10521cf159b9"], "name": "Shelly 2.5 10521CF159B9", "mdl": "Shelly 2.5", "sw": "20200812-091015/v1.8.0@8acf41b0", "mf": "Allterco Robotics"}, "~": "shellies/shellyswitch25-10521CF159B9/"}
2020-10-06 11:06:38 DEBUG (SyncWorker_18) [homeassistant.components.python_script.shellies_discovery.py] Sending to MQTT broker: homeassistant/sensor/shellyswitch25-10521CF159B9-power-1/config 
2020-10-06 11:06:38 DEBUG (SyncWorker_18) [homeassistant.components.python_script.shellies_discovery.py] Sending to MQTT broker: homeassistant/sensor/shellyswitch25-10521CF159B9-energy-1/config 
2020-10-06 11:06:38 DEBUG (SyncWorker_18) [homeassistant.components.python_script.shellies_discovery.py] Sending to MQTT broker: homeassistant/binary_sensor/shellyswitch25-10521CF159B9-input-1/config 
2020-10-06 11:06:38 DEBUG (SyncWorker_18) [homeassistant.components.python_script.shellies_discovery.py] Sending to MQTT broker: homeassistant/binary_sensor/shellyswitch25-10521CF159B9-longpush-1/config 
2020-10-06 11:06:38 DEBUG (SyncWorker_18) [homeassistant.components.python_script.shellies_discovery.py] Sending to MQTT broker: homeassistant/binary_sensor/shellyswitch25-10521CF159B9-shortpush-1/config 
2020-10-06 11:06:38 DEBUG (SyncWorker_18) [homeassistant.components.python_script.shellies_discovery.py] Sending to MQTT broker: homeassistant/binary_sensor/shellyswitch25-10521CF159B9-overpower-1/config 
2020-10-06 11:06:38 DEBUG (SyncWorker_18) [homeassistant.components.python_script.shellies_discovery.py] Sending to MQTT broker: homeassistant/sensor/shellyswitch25-10521CF159B9-temperature/config {"name": "Shelly 2.5 10521CF159B9 Temperature", "stat_t": "~temperature", "frc_upd": "False", "uniq_id": "shellyswitch25-10521cf159b9-temperature", "qos": 2, "dev": {"ids": ["10521cf159b9"], "name": "Shelly 2.5 10521CF159B9", "mdl": "Shelly 2.5", "sw": "20200812-091015/v1.8.0@8acf41b0", "mf": "Allterco Robotics"}, "~": "shellies/shellyswitch25-10521CF159B9/", "unit_of_meas": "°C", "dev_cla": "temperature", "val_tpl": "{{value|float|round(1)}}", "avty_t": "~online", "pl_avail": "true", "pl_not_avail": "false"}
2020-10-06 11:06:38 DEBUG (SyncWorker_18) [homeassistant.components.python_script.shellies_discovery.py] Sending to MQTT broker: homeassistant/sensor/shellyswitch25-10521CF159B9-rssi/config {"name": "Shelly 2.5 10521CF159B9 RSSI", "stat_t": "~info", "frc_upd": "False", "uniq_id": "shellyswitch25-10521cf159b9-rssi", "qos": 2, "dev": {"ids": ["10521cf159b9"], "name": "Shelly 2.5 10521CF159B9", "mdl": "Shelly 2.5", "sw": "20200812-091015/v1.8.0@8acf41b0", "mf": "Allterco Robotics"}, "~": "shellies/shellyswitch25-10521CF159B9/", "unit_of_meas": "dB", "dev_cla": "signal_strength", "val_tpl": "{{value_json['wifi_sta'].rssi}}", "avty_t": "~online", "pl_avail": "true", "pl_not_avail": "false"}
2020-10-06 11:06:38 DEBUG (SyncWorker_18) [homeassistant.components.python_script.shellies_discovery.py] Sending to MQTT broker: homeassistant/sensor/shellyswitch25-10521CF159B9-ssid/config {"name": "Shelly 2.5 10521CF159B9 SSID", "stat_t": "~info", "frc_upd": "False", "uniq_id": "shellyswitch25-10521cf159b9-ssid", "qos": 2, "dev": {"ids": ["10521cf159b9"], "name": "Shelly 2.5 10521CF159B9", "mdl": "Shelly 2.5", "sw": "20200812-091015/v1.8.0@8acf41b0", "mf": "Allterco Robotics"}, "~": "shellies/shellyswitch25-10521CF159B9/", "val_tpl": "{{value_json['wifi_sta'].ssid}}", "icon": "mdi:wifi", "avty_t": "~online", "pl_avail": "true", "pl_not_avail": "false"}
2020-10-06 11:06:38 DEBUG (SyncWorker_18) [homeassistant.components.python_script.shellies_discovery.py] Sending to MQTT broker: homeassistant/sensor/shellyswitch25-10521CF159B9-uptime/config {"name": "Shelly 2.5 10521CF159B9 Uptime", "stat_t": "~info", "frc_upd": "False", "uniq_id": "shellyswitch25-10521cf159b9-uptime", "qos": 2, "dev": {"ids": ["10521cf159b9"], "name": "Shelly 2.5 10521CF159B9", "mdl": "Shelly 2.5", "sw": "20200812-091015/v1.8.0@8acf41b0", "mf": "Allterco Robotics"}, "~": "shellies/shellyswitch25-10521CF159B9/", "dev_cla": "timestamp", "val_tpl": "{{(as_timestamp(now())-value_json.uptime)|timestamp_local}}", "icon": "mdi:timer-outline", "avty_t": "~online", "pl_avail": "true", "pl_not_avail": "false"}
2020-10-06 11:06:38 DEBUG (SyncWorker_18) [homeassistant.components.python_script.shellies_discovery.py] Sending to MQTT broker: homeassistant/binary_sensor/shellyswitch25-10521CF159B9-overtemperature/config {"name": "Shelly 2.5 10521CF159B9 Overtemperature", "stat_t": "~overtemperature", "uniq_id": "shellyswitch25-10521cf159b9-overtemperature", "qos": 2, "dev": {"ids": ["10521cf159b9"], "name": "Shelly 2.5 10521CF159B9", "mdl": "Shelly 2.5", "sw": "20200812-091015/v1.8.0@8acf41b0", "mf": "Allterco Robotics"}, "~": "shellies/shellyswitch25-10521CF159B9/", "pl_on": "1", "pl_off": "0", "avty_t": "~online", "pl_avail": "true", "pl_not_avail": "false", "dev_cla": "problem"}
2020-10-06 11:06:38 DEBUG (SyncWorker_18) [homeassistant.components.python_script.shellies_discovery.py] Sending to MQTT broker: homeassistant/binary_sensor/shellyswitch25-10521CF159B9-firmware-update/config {"name": "Shelly 2.5 10521CF159B9 Firmware Update", "stat_t": "~info", "uniq_id": "shellyswitch25-10521cf159b9-firmware-update", "qos": 2, "dev": {"ids": ["10521cf159b9"], "name": "Shelly 2.5 10521CF159B9", "mdl": "Shelly 2.5", "sw": "20200812-091015/v1.8.0@8acf41b0", "mf": "Allterco Robotics"}, "~": "shellies/shellyswitch25-10521CF159B9/", "val_tpl": "{%if value_json['update'].has_update==true%}ON{%else%}OFF{%endif%}", "avty_t": "~online", "pl_avail": "true", "pl_not_avail": "false", "json_attr_t": "~info", "json_attr_tpl": "{{value_json['update']|tojson}}"}

Wrong cover device_class Cover - Home Assistant

1 Like

OK that fixed the issue, thanks!

1 Like

Hi,

I have added a Shelly 1 to my network and it seems to me that everything is working correctly, but it isn’t discovered in HA.
The logs don’t have errors regarding the device…
I have checked with MQTT-Explorer and the device is there.
What could be the problem?
Thanks


Well, the problem is that I have added, not so long time ago, few shellies without problem.
It’s this one that doesn’t want to show up.
I am using Mosquito broker, which AFAIK does have discovery by default.
My hassio is on the latest version 0.115.6 (updated a day or so ago), could that have impact?

Show me please debug log for python_script component.

Is there a way to show only python_script debug log?
Or should I dig in the system log for debug messages?

2020-10-07 21:37:04 DEBUG (SyncWorker_51) [homeassistant.components.python_script.shellies_discovery.py] id: shelly1-2C8CD0, mac: 3c71bf2c8cd0, fw_ver: 20200827-065344/v1.8.3@4a8bc427, model: None
2020-10-07 21:37:04 DEBUG (SyncWorker_51) [homeassistant.components.python_script.shellies_discovery.py] Sending to MQTT broker: homeassistant/switch/shelly1-2C8CD0-relay-0/config {"name": "Shelly 1 2C8CD0 Relay 0", "cmd_t": "~relay/0/command", "stat_t": "~relay/0", "pl_off": "off", "pl_on": "on", "avty_t": "~online", "pl_avail": "true", "pl_not_avail": "false", "uniq_id": "shelly1-2c8cd0-relay-0", "qos": 0, "dev": {"ids": ["3c71bf2c8cd0"], "name": "Shelly 1 2C8CD0", "mdl": "Shelly 1", "sw": "20200827-065344/v1.8.3@4a8bc427", "mf": "Allterco Robotics"}, "~": "shellies/shelly1-2C8CD0/"}
2020-10-07 21:37:04 DEBUG (SyncWorker_51) [homeassistant.components.python_script.shellies_discovery.py] Sending to MQTT broker: homeassistant/light/shelly1-2C8CD0-relay-0/config 
2020-10-07 21:37:04 DEBUG (SyncWorker_51) [homeassistant.components.python_script.shellies_discovery.py] Sending to MQTT broker: homeassistant/fan/shelly1-2C8CD0-relay-0/config 
2020-10-07 21:37:04 DEBUG (SyncWorker_51) [homeassistant.components.python_script.shellies_discovery.py] Sending to MQTT broker: homeassistant/binary_sensor/shelly1-2C8CD0-input-0/config {"name": "Shelly 1 2C8CD0 Input 0", "stat_t": "~input/0", "avty_t": "~online", "pl_avail": "true", "pl_not_avail": "false", "uniq_id": "shelly1-2c8cd0-input-0", "qos": 0, "dev": {"ids": ["3c71bf2c8cd0"], "name": "Shelly 1 2C8CD0", "mdl": "Shelly 1", "sw": "20200827-065344/v1.8.3@4a8bc427", "mf": "Allterco Robotics"}, "~": "shellies/shelly1-2C8CD0/", "pl_on": "1", "pl_off": "0"}
2020-10-07 21:37:04 DEBUG (SyncWorker_51) [homeassistant.components.python_script.shellies_discovery.py] Sending to MQTT broker: homeassistant/binary_sensor/shelly1-2C8CD0-longpush-0/config {"name": "Shelly 1 2C8CD0 Longpush 0", "stat_t": "~longpush/0", "avty_t": "~online", "pl_avail": "true", "pl_not_avail": "false", "uniq_id": "shelly1-2c8cd0-longpush-0", "qos": 0, "dev": {"ids": ["3c71bf2c8cd0"], "name": "Shelly 1 2C8CD0", "mdl": "Shelly 1", "sw": "20200827-065344/v1.8.3@4a8bc427", "mf": "Allterco Robotics"}, "~": "shellies/shelly1-2C8CD0/", "off_dly": 2, "pl_on": "1", "pl_off": "0"}
2020-10-07 21:37:04 DEBUG (SyncWorker_51) [homeassistant.components.python_script.shellies_discovery.py] Sending to MQTT broker: homeassistant/binary_sensor/shelly1-2C8CD0-shortpush-0/config {"name": "Shelly 1 2C8CD0 Shortpush 0", "stat_t": "~longpush/0", "avty_t": "~online", "pl_avail": "true", "pl_not_avail": "false", "uniq_id": "shelly1-2c8cd0-shortpush-0", "qos": 0, "dev": {"ids": ["3c71bf2c8cd0"], "name": "Shelly 1 2C8CD0", "mdl": "Shelly 1", "sw": "20200827-065344/v1.8.3@4a8bc427", "mf": "Allterco Robotics"}, "~": "shellies/shelly1-2C8CD0/", "off_dly": 2, "pl_on": "0", "pl_off": "1"}
2020-10-07 21:37:04 DEBUG (SyncWorker_51) [homeassistant.components.python_script.shellies_discovery.py] Sending to MQTT broker: homeassistant/sensor/shelly1-2C8CD0-rssi/config {"name": "Shelly 1 2C8CD0 RSSI", "stat_t": "~info", "frc_upd": "False", "uniq_id": "shelly1-2c8cd0-rssi", "qos": 0, "dev": {"ids": ["3c71bf2c8cd0"], "name": "Shelly 1 2C8CD0", "mdl": "Shelly 1", "sw": "20200827-065344/v1.8.3@4a8bc427", "mf": "Allterco Robotics"}, "~": "shellies/shelly1-2C8CD0/", "unit_of_meas": "dB", "dev_cla": "signal_strength", "val_tpl": "{{value_json['wifi_sta'].rssi}}", "avty_t": "~online", "pl_avail": "true", "pl_not_avail": "false"}
2020-10-07 21:37:04 DEBUG (SyncWorker_51) [homeassistant.components.python_script.shellies_discovery.py] Sending to MQTT broker: homeassistant/sensor/shelly1-2C8CD0-ssid/config {"name": "Shelly 1 2C8CD0 SSID", "stat_t": "~info", "frc_upd": "False", "uniq_id": "shelly1-2c8cd0-ssid", "qos": 0, "dev": {"ids": ["3c71bf2c8cd0"], "name": "Shelly 1 2C8CD0", "mdl": "Shelly 1", "sw": "20200827-065344/v1.8.3@4a8bc427", "mf": "Allterco Robotics"}, "~": "shellies/shelly1-2C8CD0/", "val_tpl": "{{value_json['wifi_sta'].ssid}}", "icon": "mdi:wifi", "avty_t": "~online", "pl_avail": "true", "pl_not_avail": "false"}
2020-10-07 21:37:04 DEBUG (SyncWorker_51) [homeassistant.components.python_script.shellies_discovery.py] Sending to MQTT broker: homeassistant/sensor/shelly1-2C8CD0-uptime/config {"name": "Shelly 1 2C8CD0 Uptime", "stat_t": "~info", "frc_upd": "False", "uniq_id": "shelly1-2c8cd0-uptime", "qos": 0, "dev": {"ids": ["3c71bf2c8cd0"], "name": "Shelly 1 2C8CD0", "mdl": "Shelly 1", "sw": "20200827-065344/v1.8.3@4a8bc427", "mf": "Allterco Robotics"}, "~": "shellies/shelly1-2C8CD0/", "dev_cla": "timestamp", "val_tpl": "{{(as_timestamp(now())-value_json.uptime)|timestamp_local}}", "icon": "mdi:timer-outline", "avty_t": "~online", "pl_avail": "true", "pl_not_avail": "false"}
2020-10-07 21:37:04 DEBUG (SyncWorker_51) [homeassistant.components.python_script.shellies_discovery.py] Sending to MQTT broker: homeassistant/sensor/shelly1-2C8CD0-ext-temperature-0/config 
2020-10-07 21:37:04 DEBUG (SyncWorker_51) [homeassistant.components.python_script.shellies_discovery.py] Sending to MQTT broker: homeassistant/sensor/shelly1-2C8CD0-ext-temperature-1/config 
2020-10-07 21:37:04 DEBUG (SyncWorker_51) [homeassistant.components.python_script.shellies_discovery.py] Sending to MQTT broker: homeassistant/sensor/shelly1-2C8CD0-ext-temperature-2/config 
2020-10-07 21:37:04 DEBUG (SyncWorker_51) [homeassistant.components.python_script.shellies_discovery.py] Sending to MQTT broker: homeassistant/sensor/shelly1-2C8CD0-ext-humidity-0/config 
2020-10-07 21:37:04 DEBUG (SyncWorker_51) [homeassistant.components.python_script.shellies_discovery.py] Sending to MQTT broker: homeassistant/binary_sensor/shelly1-2C8CD0-firmware-update/config {"name": "Shelly 1 2C8CD0 Firmware Update", "stat_t": "~info", "uniq_id": "shelly1-2c8cd0-firmware-update", "qos": 0, "dev": {"ids": ["3c71bf2c8cd0"], "name": "Shelly 1 2C8CD0", "mdl": "Shelly 1", "sw": "20200827-065344/v1.8.3@4a8bc427", "mf": "Allterco Robotics"}, "~": "shellies/shelly1-2C8CD0/", "val_tpl": "{%if value_json['update'].has_update==true%}ON{%else%}OFF{%endif%}", "avty_t": "~online", "pl_avail": "true", "pl_not_avail": "false", "json_attr_t": "~info", "json_attr_tpl": "{{value_json['update']|tojson}}"}
2020-10-07 21:37:41 DEBUG (SyncWorker_22) [homeassistant.components.python_script.shellies_discovery.py] id: shelly1-2C8CD0, mac: 3c71bf2c8cd0, fw_ver: 20200827-065344/v1.8.3@4a8bc427, model: None
2020-10-07 21:37:41 DEBUG (SyncWorker_22) [homeassistant.components.python_script.shellies_discovery.py] Sending to MQTT broker: homeassistant/switch/shelly1-2C8CD0-relay-0/config {"name": "Shelly 1 2C8CD0 Relay 0", "cmd_t": "~relay/0/command", "stat_t": "~relay/0", "pl_off": "off", "pl_on": "on", "avty_t": "~online", "pl_avail": "true", "pl_not_avail": "false", "uniq_id": "shelly1-2c8cd0-relay-0", "qos": 0, "dev": {"ids": ["3c71bf2c8cd0"], "name": "Shelly 1 2C8CD0", "mdl": "Shelly 1", "sw": "20200827-065344/v1.8.3@4a8bc427", "mf": "Allterco Robotics"}, "~": "shellies/shelly1-2C8CD0/"}
2020-10-07 21:37:41 DEBUG (SyncWorker_22) [homeassistant.components.python_script.shellies_discovery.py] Sending to MQTT broker: homeassistant/light/shelly1-2C8CD0-relay-0/config 
2020-10-07 21:37:41 DEBUG (SyncWorker_22) [homeassistant.components.python_script.shellies_discovery.py] Sending to MQTT broker: homeassistant/fan/shelly1-2C8CD0-relay-0/config 
2020-10-07 21:37:41 DEBUG (SyncWorker_22) [homeassistant.components.python_script.shellies_discovery.py] Sending to MQTT broker: homeassistant/binary_sensor/shelly1-2C8CD0-input-0/config {"name": "Shelly 1 2C8CD0 Input 0", "stat_t": "~input/0", "avty_t": "~online", "pl_avail": "true", "pl_not_avail": "false", "uniq_id": "shelly1-2c8cd0-input-0", "qos": 0, "dev": {"ids": ["3c71bf2c8cd0"], "name": "Shelly 1 2C8CD0", "mdl": "Shelly 1", "sw": "20200827-065344/v1.8.3@4a8bc427", "mf": "Allterco Robotics"}, "~": "shellies/shelly1-2C8CD0/", "pl_on": "1", "pl_off": "0"}
2020-10-07 21:37:41 DEBUG (SyncWorker_22) [homeassistant.components.python_script.shellies_discovery.py] Sending to MQTT broker: homeassistant/binary_sensor/shelly1-2C8CD0-longpush-0/config {"name": "Shelly 1 2C8CD0 Longpush 0", "stat_t": "~longpush/0", "avty_t": "~online", "pl_avail": "true", "pl_not_avail": "false", "uniq_id": "shelly1-2c8cd0-longpush-0", "qos": 0, "dev": {"ids": ["3c71bf2c8cd0"], "name": "Shelly 1 2C8CD0", "mdl": "Shelly 1", "sw": "20200827-065344/v1.8.3@4a8bc427", "mf": "Allterco Robotics"}, "~": "shellies/shelly1-2C8CD0/", "off_dly": 2, "pl_on": "1", "pl_off": "0"}
2020-10-07 21:37:41 DEBUG (SyncWorker_22) [homeassistant.components.python_script.shellies_discovery.py] Sending to MQTT broker: homeassistant/binary_sensor/shelly1-2C8CD0-shortpush-0/config {"name": "Shelly 1 2C8CD0 Shortpush 0", "stat_t": "~longpush/0", "avty_t": "~online", "pl_avail": "true", "pl_not_avail": "false", "uniq_id": "shelly1-2c8cd0-shortpush-0", "qos": 0, "dev": {"ids": ["3c71bf2c8cd0"], "name": "Shelly 1 2C8CD0", "mdl": "Shelly 1", "sw": "20200827-065344/v1.8.3@4a8bc427", "mf": "Allterco Robotics"}, "~": "shellies/shelly1-2C8CD0/", "off_dly": 2, "pl_on": "0", "pl_off": "1"}
2020-10-07 21:37:41 DEBUG (SyncWorker_22) [homeassistant.components.python_script.shellies_discovery.py] Sending to MQTT broker: homeassistant/sensor/shelly1-2C8CD0-rssi/config {"name": "Shelly 1 2C8CD0 RSSI", "stat_t": "~info", "frc_upd": "False", "uniq_id": "shelly1-2c8cd0-rssi", "qos": 0, "dev": {"ids": ["3c71bf2c8cd0"], "name": "Shelly 1 2C8CD0", "mdl": "Shelly 1", "sw": "20200827-065344/v1.8.3@4a8bc427", "mf": "Allterco Robotics"}, "~": "shellies/shelly1-2C8CD0/", "unit_of_meas": "dB", "dev_cla": "signal_strength", "val_tpl": "{{value_json['wifi_sta'].rssi}}", "avty_t": "~online", "pl_avail": "true", "pl_not_avail": "false"}
2020-10-07 21:37:41 DEBUG (SyncWorker_22) [homeassistant.components.python_script.shellies_discovery.py] Sending to MQTT broker: homeassistant/sensor/shelly1-2C8CD0-ssid/config {"name": "Shelly 1 2C8CD0 SSID", "stat_t": "~info", "frc_upd": "False", "uniq_id": "shelly1-2c8cd0-ssid", "qos": 0, "dev": {"ids": ["3c71bf2c8cd0"], "name": "Shelly 1 2C8CD0", "mdl": "Shelly 1", "sw": "20200827-065344/v1.8.3@4a8bc427", "mf": "Allterco Robotics"}, "~": "shellies/shelly1-2C8CD0/", "val_tpl": "{{value_json['wifi_sta'].ssid}}", "icon": "mdi:wifi", "avty_t": "~online", "pl_avail": "true", "pl_not_avail": "false"}
2020-10-07 21:37:41 DEBUG (SyncWorker_22) [homeassistant.components.python_script.shellies_discovery.py] Sending to MQTT broker: homeassistant/sensor/shelly1-2C8CD0-uptime/config {"name": "Shelly 1 2C8CD0 Uptime", "stat_t": "~info", "frc_upd": "False", "uniq_id": "shelly1-2c8cd0-uptime", "qos": 0, "dev": {"ids": ["3c71bf2c8cd0"], "name": "Shelly 1 2C8CD0", "mdl": "Shelly 1", "sw": "20200827-065344/v1.8.3@4a8bc427", "mf": "Allterco Robotics"}, "~": "shellies/shelly1-2C8CD0/", "dev_cla": "timestamp", "val_tpl": "{{(as_timestamp(now())-value_json.uptime)|timestamp_local}}", "icon": "mdi:timer-outline", "avty_t": "~online", "pl_avail": "true", "pl_not_avail": "false"}
2020-10-07 21:37:41 DEBUG (SyncWorker_22) [homeassistant.components.python_script.shellies_discovery.py] Sending to MQTT broker: homeassistant/sensor/shelly1-2C8CD0-ext-temperature-0/config 
2020-10-07 21:37:41 DEBUG (SyncWorker_22) [homeassistant.components.python_script.shellies_discovery.py] Sending to MQTT broker: homeassistant/sensor/shelly1-2C8CD0-ext-temperature-1/config 
2020-10-07 21:37:41 DEBUG (SyncWorker_22) [homeassistant.components.python_script.shellies_discovery.py] Sending to MQTT broker: homeassistant/sensor/shelly1-2C8CD0-ext-temperature-2/config 
2020-10-07 21:37:41 DEBUG (SyncWorker_22) [homeassistant.components.python_script.shellies_discovery.py] Sending to MQTT broker: homeassistant/sensor/shelly1-2C8CD0-ext-humidity-0/config 
2020-10-07 21:37:41 DEBUG (SyncWorker_22) [homeassistant.components.python_script.shellies_discovery.py] Sending to MQTT broker: homeassistant/binary_sensor/shelly1-2C8CD0-firmware-update/config {"name": "Shelly 1 2C8CD0 Firmware Update", "stat_t": "~info", "uniq_id": "shelly1-2c8cd0-firmware-update", "qos": 0, "dev": {"ids": ["3c71bf2c8cd0"], "name": "Shelly 1 2C8CD0", "mdl": "Shelly 1", "sw": "20200827-065344/v1.8.3@4a8bc427", "mf": "Allterco Robotics"}, "~": "shellies/shelly1-2C8CD0/", "val_tpl": "{%if value_json['update'].has_update==true%}ON{%else%}OFF{%endif%}", "avty_t": "~online", "pl_avail": "true", "pl_not_avail": "false", "json_attr_t": "~info", "json_attr_tpl": "{{value_json['update']|tojson}}"}

Here is the DEBUG log.

Is shelly1-2C8CD0 your new Shelly device? The script works fine. Maybe your discovery prefix is different than homeassistant?

You should update your shellies_discovery automation because model is missing https://github.com/bieniu/ha-shellies-discovery#minimal-configuration

Ok, I managed to make it working by myself.
It seems that the problem was on the shelly side, don’t know what exactly.
I cleared the MQTT option, restarted, put the MQTT back on, restarted, and voila the script picked it up right away.
Thanks anyway.

1 Like

The shelly device is shelly1-554C66 and there was no sign of it in the logs.
Did the changes in automation.yaml, thanks for pointing that out.

1 Like

New version: 0.31.0

Changelog:

  • add support for Shelly Plug E (SHPLG2-1)