Shellies Discovery Script

I have got the following error in my HA log:

2020-09-08 22:09:11 ERROR (SyncWorker_6) [homeassistant.components.python_script.shellies_discovery.py] Error executing script:  is wrong dev_id argument
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/python_script/__init__.py", line 205, in execute
    exec(compiled.code, restricted_globals)
  File "shellies_discovery.py", line 434, in <module>
ValueError:  is wrong dev_id argument

Everything appears to be working normally, I only have one Shelly device and it is reporting back correctly and can be controlled.

My automations are set up as follows:

Announce:

- id: shellies_announce
  alias: 'Shellies Announce'
  trigger:
    - platform: homeassistant
      event: start
    - platform: time_pattern
      hours: "/1"
  action:
    service: mqtt.publish
    data:
      topic: shellies/command
      payload: announce

Discovery:

- id: 'shellies_discovery'
  alias: 'Shellies Discovery'
  mode: queued
  max: 999
  trigger:
    platform: mqtt
    topic: shellies/announce
  action:
    service: python_script.shellies_discovery
    data_template:
      id: '{{ trigger.payload_json.id }}'
      mac: '{{ trigger.payload_json.mac }}'
      fw_ver: '{{ trigger.payload_json.fw_ver }}'
      model: '{{ trigger.payload_json.model }}'
      shelly1-garage:
        relay-0: "light"
        ext-temperature-0: true
        force_update_sensors: true

Any ideas what is causing the error?

Thanks

Please update the script.

There’s no update available in HACS, do I need to update manually from the git repo?

Which version of the script do you use?

According to HACS it is 0.29.1

Strange. Please try to reinstall the script and restart HA.

I’ve done that and get the same error when the automations run:

Logger: homeassistant.components.python_script.shellies_discovery.py
Source: components/python_script/__init__.py:205
Integration: Python Scripts (documentation, issues)
First occurred: 15:25:19 (3 occurrences)
Last logged: 15:25:20

Error executing script: is wrong dev_id argument
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/python_script/__init__.py", line 205, in execute
    exec(compiled.code, restricted_globals)
  File "shellies_discovery.py", line 434, in <module>
ValueError:  is wrong dev_id argument

@Bieniu

What do you recommend for the mqtt settings in the Shelly? As of right now, I have the following.

Username: <set>
Password: <set>
Server: <ip>:1883
Use custom MQTT prefix: [CHECKED]
Custom prefix value: shellyplugu1-AAAAAA     #NOTE: unique as per the ID of the Shelly
Min reconnect timeout: 2
Max reconnect timeout: 60
Keep alive: 60
Clean Session: [CHECKED]
Retain: [CHECKED]
Max QoS: 2

Specifically…

  1. I want to make sure that it is recommended to set a custom MQTT prefix.
  2. For the most stable operation, should we have the “Retain” flag checked?
  3. What would be the recommended value for “Max QoS”?
  4. Are there any other settings that you would recommend that we adjust in the Shelly? (For instance, “Power On Default Mode?”)

Perhaps these instructions could be added to the documentation?

For what it’s worth, it seems to be working for me as is. I just want to make sure that I won’t run into trouble later. Thank you for your work on this!

Please show me payload of announce topic from the device.

There is no recommendation for that. If you need custom prefix you can use it.

The script works regardless of these settings. This is the user’s decision.

This is the payload:

{"id":"shelly1-garage","model":"SHSW-1","mac":"E098069614C9","ip":"192.168.1.74","new_fw":false,"fw_ver":"20200827-065344/v1.8.3@4a8bc427"}

Check line 19 in the script. It should be like here https://github.com/bieniu/ha-shellies-discovery/blob/35dfcf04c59a6f41930530cf1ce4cb1867661700/python_scripts/shellies_discovery.py#L19

Turn on debug for python_script https://github.com/bieniu/ha-shellies-discovery#how-to-debug and show me the log after run announce automation.

For me your configuration works without error:

2020-09-10 08:36:08 INFO (SyncWorker_6) [homeassistant.components.python_script] Executing shellies_discovery.py: {'id': 'shelly1-garage', 'mac': 'E098069614C9', 'fw_ver': '20200827-065344/v1.8.3@4a8bc427', 'model': 'SHSW-1', 'qos': 1, 'discovery_prefix': 'qwerty', 'shelly1-garage': {'relay-0': 'light', 'ext-temperature-0': True, 'force_update_sensors': True}}
2020-09-10 08:36:08 DEBUG (SyncWorker_6) [homeassistant.components.python_script.shellies_discovery.py] id: shelly1-garage, mac: e098069614c9, fw_ver: 20200827-065344/v1.8.3@4a8bc427, model: SHSW-1
2020-09-10 08:36:08 DEBUG (SyncWorker_6) [homeassistant.components.python_script.shellies_discovery.py] Sending to MQTT broker: qwerty/switch/shelly1-garage-relay-0/config 
2020-09-10 08:36:08 DEBUG (SyncWorker_6) [homeassistant.components.python_script.shellies_discovery.py] Sending to MQTT broker: qwerty/light/shelly1-garage-relay-0/config {"name": "Shelly 1 garage 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-garage-relay-0", "qos": 1, "dev": {"ids": ["e098069614c9"], "name": "Shelly 1 garage", "mdl": "Shelly 1", "sw": "20200827-065344/v1.8.3@4a8bc427", "mf": "Allterco Robotics"}, "~": "shellies/shelly1-garage/"}
2020-09-10 08:36:08 DEBUG (SyncWorker_6) [homeassistant.components.python_script.shellies_discovery.py] Sending to MQTT broker: qwerty/fan/shelly1-garage-relay-0/config 
2020-09-10 08:36:08 DEBUG (SyncWorker_6) [homeassistant.components.python_script.shellies_discovery.py] Sending to MQTT broker: qwerty/binary_sensor/shelly1-garage-input-0/config {"name": "Shelly 1 garage Input 0", "stat_t": "~input/0", "avty_t": "~online", "pl_avail": "true", "pl_not_avail": "false", "uniq_id": "shelly1-garage-input-0", "qos": 1, "dev": {"ids": ["e098069614c9"], "name": "Shelly 1 garage", "mdl": "Shelly 1", "sw": "20200827-065344/v1.8.3@4a8bc427", "mf": "Allterco Robotics"}, "~": "shellies/shelly1-garage/", "pl_on": "1", "pl_off": "0"}
2020-09-10 08:36:08 DEBUG (SyncWorker_6) [homeassistant.components.python_script.shellies_discovery.py] Sending to MQTT broker: qwerty/binary_sensor/shelly1-garage-longpush-0/config {"name": "Shelly 1 garage Longpush 0", "stat_t": "~longpush/0", "avty_t": "~online", "pl_avail": "true", "pl_not_avail": "false", "uniq_id": "shelly1-garage-longpush-0", "qos": 1, "dev": {"ids": ["e098069614c9"], "name": "Shelly 1 garage", "mdl": "Shelly 1", "sw": "20200827-065344/v1.8.3@4a8bc427", "mf": "Allterco Robotics"}, "~": "shellies/shelly1-garage/", "off_dly": 2, "pl_on": "1", "pl_off": "0"}
2020-09-10 08:36:08 DEBUG (SyncWorker_6) [homeassistant.components.python_script.shellies_discovery.py] Sending to MQTT broker: qwerty/binary_sensor/shelly1-garage-shortpush-0/config {"name": "Shelly 1 garage Shortpush 0", "stat_t": "~longpush/0", "avty_t": "~online", "pl_avail": "true", "pl_not_avail": "false", "uniq_id": "shelly1-garage-shortpush-0", "qos": 1, "dev": {"ids": ["e098069614c9"], "name": "Shelly 1 garage", "mdl": "Shelly 1", "sw": "20200827-065344/v1.8.3@4a8bc427", "mf": "Allterco Robotics"}, "~": "shellies/shelly1-garage/", "off_dly": 2, "pl_on": "0", "pl_off": "1"}
2020-09-10 08:36:08 DEBUG (SyncWorker_6) [homeassistant.components.python_script.shellies_discovery.py] Sending to MQTT broker: qwerty/sensor/shelly1-garage-rssi/config {"name": "Shelly 1 garage RSSI", "stat_t": "~info", "exp_aft": 43200, "frc_upd": "True", "uniq_id": "shelly1-garage-rssi", "qos": 1, "dev": {"ids": ["e098069614c9"], "name": "Shelly 1 garage", "mdl": "Shelly 1", "sw": "20200827-065344/v1.8.3@4a8bc427", "mf": "Allterco Robotics"}, "~": "shellies/shelly1-garage/", "unit_of_meas": "dB", "dev_cla": "signal_strength", "avty_t": "~online", "pl_avail": "true", "pl_not_avail": "false", "val_tpl": "{{value_json['wifi_sta'].rssi}}"}
2020-09-10 08:36:08 DEBUG (SyncWorker_6) [homeassistant.components.python_script.shellies_discovery.py] Sending to MQTT broker: qwerty/sensor/shelly1-garage-ssid/config {"name": "Shelly 1 garage SSID", "stat_t": "~info", "exp_aft": 43200, "frc_upd": "True", "uniq_id": "shelly1-garage-ssid", "qos": 1, "dev": {"ids": ["e098069614c9"], "name": "Shelly 1 garage", "mdl": "Shelly 1", "sw": "20200827-065344/v1.8.3@4a8bc427", "mf": "Allterco Robotics"}, "~": "shellies/shelly1-garage/", "avty_t": "~online", "pl_avail": "true", "pl_not_avail": "false", "val_tpl": "{{value_json['wifi_sta'].ssid}}", "icon": "mdi:wifi"}
2020-09-10 08:36:08 DEBUG (SyncWorker_6) [homeassistant.components.python_script.shellies_discovery.py] Sending to MQTT broker: qwerty/sensor/shelly1-garage-uptime/config {"name": "Shelly 1 garage Uptime", "stat_t": "~info", "exp_aft": 43200, "frc_upd": "True", "uniq_id": "shelly1-garage-uptime", "qos": 1, "dev": {"ids": ["e098069614c9"], "name": "Shelly 1 garage", "mdl": "Shelly 1", "sw": "20200827-065344/v1.8.3@4a8bc427", "mf": "Allterco Robotics"}, "~": "shellies/shelly1-garage/", "dev_cla": "timestamp", "avty_t": "~online", "pl_avail": "true", "pl_not_avail": "false", "val_tpl": "{{(as_timestamp(now())-value_json.uptime)|timestamp_local}}", "icon": "mdi:timer-outline"}
2020-09-10 08:36:08 DEBUG (SyncWorker_6) [homeassistant.components.python_script.shellies_discovery.py] Sending to MQTT broker: qwerty/sensor/shelly1-garage-ext-0/config 
2020-09-10 08:36:08 DEBUG (SyncWorker_6) [homeassistant.components.python_script.shellies_discovery.py] Sending to MQTT broker: qwerty/sensor/shelly1-garage-ext-1/config 
2020-09-10 08:36:08 DEBUG (SyncWorker_6) [homeassistant.components.python_script.shellies_discovery.py] Sending to MQTT broker: qwerty/sensor/shelly1-garage-ext-2/config 
2020-09-10 08:36:08 DEBUG (SyncWorker_6) [homeassistant.components.python_script.shellies_discovery.py] Sending to MQTT broker: qwerty/sensor/shelly1-garage-ext-temperature-0/config {"name": "Shelly 1 garage External Temperature 0", "stat_t": "~ext_temperature/0", "val_tpl": "{%if value != 999%}{{value|float|round(1)}}{%endif%}", "unit_of_meas": "°C", "dev_cla": "temperature", "exp_aft": 43200, "frc_upd": "True", "avty_t": "~online", "pl_avail": "true", "pl_not_avail": "false", "uniq_id": "shelly1-garage-ext-temperature-0", "qos": 1, "dev": {"ids": ["e098069614c9"], "name": "Shelly 1 garage", "mdl": "Shelly 1", "sw": "20200827-065344/v1.8.3@4a8bc427", "mf": "Allterco Robotics"}, "~": "shellies/shelly1-garage/"}
2020-09-10 08:36:08 DEBUG (SyncWorker_6) [homeassistant.components.python_script.shellies_discovery.py] Sending to MQTT broker: qwerty/sensor/shelly1-garage-ext-temperature-1/config 
2020-09-10 08:36:08 DEBUG (SyncWorker_6) [homeassistant.components.python_script.shellies_discovery.py] Sending to MQTT broker: qwerty/sensor/shelly1-garage-ext-temperature-2/config 
2020-09-10 08:36:08 DEBUG (SyncWorker_6) [homeassistant.components.python_script.shellies_discovery.py] Sending to MQTT broker: qwerty/sensor/shelly1-garage-ext-humidity-0/config {"name": "Shelly 1 garage External Humidity 0", "stat_t": "~ext_humidity/0", "val_tpl": "{%if value!=999%}{{value|float|round(1)}}{%endif%}", "unit_of_meas": "%", "dev_cla": "humidity", "exp_aft": 43200, "frc_upd": "True", "avty_t": "~online", "pl_avail": "true", "pl_not_avail": "false", "uniq_id": "shelly1-garage-ext-humidity-0", "qos": 1, "dev": {"ids": ["e098069614c9"], "name": "Shelly 1 garage", "mdl": "Shelly 1", "sw": "20200827-065344/v1.8.3@4a8bc427", "mf": "Allterco Robotics"}, "~": "shellies/shelly1-garage/"}
2020-09-10 08:36:08 DEBUG (SyncWorker_6) [homeassistant.components.python_script.shellies_discovery.py] Sending to MQTT broker: qwerty/binary_sensor/shelly1-garage-firmware-update/config {"name": "Shelly 1 garage Firmware Update", "stat_t": "~info", "uniq_id": "shelly1-garage-firmware-update", "qos": 1, "dev": {"ids": ["e098069614c9"], "name": "Shelly 1 garage", "mdl": "Shelly 1", "sw": "20200827-065344/v1.8.3@4a8bc427", "mf": "Allterco Robotics"}, "~": "shellies/shelly1-garage/", "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}}"}

I have checked line 19 in the script on my system and it matches line 19 in the git link that you posted. I have also checked line 434 (https://github.com/bieniu/ha-shellies-discovery/blob/35dfcf04c59a6f41930530cf1ce4cb1867661700/python_scripts/shellies_discovery.py#L434) as that is referenced in the error message and it is different, on my system it is:

433 - if not dev_id:
434 -     raise ValueError(f"{dev_id} is wrong dev_id argument")

Before I start debugging could that be the problem?

This difference is only in log string and it doesn’t impact the script behavior. You can update script to 0.29.2 if you want before debug.

I have updated to 0.29.2 and error was still occurring:

Logger: homeassistant.components.python_script.shellies_discovery.py
Source: components/python_script/__init__.py:205
Integration: Python Scripts (documentation, issues)
First occurred: 10:32:10 (1 occurrences)
Last logged: 10:32:10

Error executing script: is wrong id argument
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/python_script/__init__.py", line 205, in execute
    exec(compiled.code, restricted_globals)
  File "shellies_discovery.py", line 434, in <module>
ValueError:  is wrong id argument

After enabling debugging, restarting HA and running automations I can’t reproduce the errors:

2020-09-10 10:46:43 INFO (MainThread) [homeassistant.components.automation.shellies_announce] Executing Shellies Announce
2020-09-10 10:46:43 INFO (MainThread) [homeassistant.components.automation.shellies_announce] Shellies Announce: Running script
2020-09-10 10:46:43 INFO (MainThread) [homeassistant.components.automation.shellies_announce] Shellies Announce: Executing step call service
2020-09-10 10:46:43 INFO (MainThread) [homeassistant.components.automation.shellies_discovery] Executing Shellies Discovery
2020-09-10 10:46:43 INFO (MainThread) [homeassistant.components.automation.shellies_discovery] Shellies Discovery: Running script
2020-09-10 10:46:43 INFO (MainThread) [homeassistant.components.automation.shellies_discovery] Shellies Discovery: Executing step call service
2020-09-10 10:46:43 INFO (SyncWorker_14) [homeassistant.components.python_script] Executing shellies_discovery.py: {'id': 'shelly1-garage', 'mac': 'E098069614C9', 'fw_ver': '20200827-065344/v1.8.3@4a8bc427', 'model': 'SHSW-1', 'shelly1-garage': {'relay-0': 'light', 'ext-temperature-0': True, 'force_update_sensors': True}}
2020-09-10 10:46:43 DEBUG (SyncWorker_14) [homeassistant.components.python_script.shellies_discovery.py] id: shelly1-garage, mac: e098069614c9, fw_ver: 20200827-065344/v1.8.3@4a8bc427, model: SHSW-1
2020-09-10 10:46:43 DEBUG (SyncWorker_14) [homeassistant.components.python_script.shellies_discovery.py] Sending to MQTT broker: homeassistant/switch/shelly1-garage-relay-0/config
2020-09-10 10:46:43 DEBUG (SyncWorker_14) [homeassistant.components.python_script.shellies_discovery.py] Sending to MQTT broker: homeassistant/light/shelly1-garage-relay-0/config {"name": "Shelly 1 garage 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-garage-relay-0", "qos": 0, "dev": {"ids": ["e098069614c9"], "name": "Shelly 1 garage", "mdl": "Shelly 1", "sw": "20200827-065344/v1.8.3@4a8bc427", "mf": "Allterco Robotics"}, "~": "shellies/shelly1-garage/"}
2020-09-10 10:46:43 DEBUG (SyncWorker_14) [homeassistant.components.python_script.shellies_discovery.py] Sending to MQTT broker: homeassistant/fan/shelly1-garage-relay-0/config
2020-09-10 10:46:43 DEBUG (SyncWorker_14) [homeassistant.components.python_script.shellies_discovery.py] Sending to MQTT broker: homeassistant/binary_sensor/shelly1-garage-input-0/config {"name": "Shelly 1 garage Input 0", "stat_t": "~input/0", "avty_t": "~online", "pl_avail": "true", "pl_not_avail": "false", "uniq_id": "shelly1-garage-input-0", "qos": 0, "dev": {"ids": ["e098069614c9"], "name": "Shelly 1 garage", "mdl": "Shelly 1", "sw": "20200827-065344/v1.8.3@4a8bc427", "mf": "Allterco Robotics"}, "~": "shellies/shelly1-garage/", "pl_on": "1", "pl_off": "0"}
2020-09-10 10:46:43 DEBUG (SyncWorker_14) [homeassistant.components.python_script.shellies_discovery.py] Sending to MQTT broker: homeassistant/binary_sensor/shelly1-garage-longpush-0/config {"name": "Shelly 1 garage Longpush 0", "stat_t": "~longpush/0", "avty_t": "~online", "pl_avail": "true", "pl_not_avail": "false", "uniq_id": "shelly1-garage-longpush-0", "qos": 0, "dev": {"ids": ["e098069614c9"], "name": "Shelly 1 garage", "mdl": "Shelly 1", "sw": "20200827-065344/v1.8.3@4a8bc427", "mf": "Allterco Robotics"}, "~": "shellies/shelly1-garage/", "off_dly": 2, "pl_on": "1", "pl_off": "0"}
2020-09-10 10:46:43 DEBUG (SyncWorker_14) [homeassistant.components.python_script.shellies_discovery.py] Sending to MQTT broker: homeassistant/binary_sensor/shelly1-garage-shortpush-0/config {"name": "Shelly 1 garage Shortpush 0", "stat_t": "~longpush/0", "avty_t": "~online", "pl_avail": "true", "pl_not_avail": "false", "uniq_id": "shelly1-garage-shortpush-0", "qos": 0, "dev": {"ids": ["e098069614c9"], "name": "Shelly 1 garage", "mdl": "Shelly 1", "sw": "20200827-065344/v1.8.3@4a8bc427", "mf": "Allterco Robotics"}, "~": "shellies/shelly1-garage/", "off_dly": 2, "pl_on": "0", "pl_off": "1"}
2020-09-10 10:46:43 DEBUG (SyncWorker_14) [homeassistant.components.python_script.shellies_discovery.py] Sending to MQTT broker: homeassistant/sensor/shelly1-garage-rssi/config {"name": "Shelly 1 garage RSSI", "stat_t": "~info", "exp_aft": 43200, "frc_upd": "True", "uniq_id": "shelly1-garage-rssi", "qos": 0, "dev": {"ids": ["e098069614c9"], "name": "Shelly 1 garage", "mdl": "Shelly 1", "sw": "20200827-065344/v1.8.3@4a8bc427", "mf": "Allterco Robotics"}, "~": "shellies/shelly1-garage/", "unit_of_meas": "dB", "dev_cla": "signal_strength", "avty_t": "~online", "pl_avail": "true", "pl_not_avail": "false", "val_tpl": "{{value_json['wifi_sta'].rssi}}"}
2020-09-10 10:46:43 DEBUG (SyncWorker_14) [homeassistant.components.python_script.shellies_discovery.py] Sending to MQTT broker: homeassistant/sensor/shelly1-garage-ssid/config {"name": "Shelly 1 garage SSID", "stat_t": "~info", "exp_aft": 43200, "frc_upd": "True", "uniq_id": "shelly1-garage-ssid", "qos": 0, "dev": {"ids": ["e098069614c9"], "name": "Shelly 1 garage", "mdl": "Shelly 1", "sw": "20200827-065344/v1.8.3@4a8bc427", "mf": "Allterco Robotics"}, "~": "shellies/shelly1-garage/", "avty_t": "~online", "pl_avail": "true", "pl_not_avail": "false", "val_tpl": "{{value_json['wifi_sta'].ssid}}", "icon": "mdi:wifi"}
2020-09-10 10:46:43 DEBUG (SyncWorker_14) [homeassistant.components.python_script.shellies_discovery.py] Sending to MQTT broker: homeassistant/sensor/shelly1-garage-uptime/config {"name": "Shelly 1 garage Uptime", "stat_t": "~info", "exp_aft": 43200, "frc_upd": "True", "uniq_id": "shelly1-garage-uptime", "qos": 0, "dev": {"ids": ["e098069614c9"], "name": "Shelly 1 garage", "mdl": "Shelly 1", "sw": "20200827-065344/v1.8.3@4a8bc427", "mf": "Allterco Robotics"}, "~": "shellies/shelly1-garage/", "dev_cla": "timestamp", "avty_t": "~online", "pl_avail": "true", "pl_not_avail": "false", "val_tpl": "{{(as_timestamp(now())-value_json.uptime)|timestamp_local}}", "icon": "mdi:timer-outline"}
2020-09-10 10:46:43 DEBUG (SyncWorker_14) [homeassistant.components.python_script.shellies_discovery.py] Sending to MQTT broker: homeassistant/sensor/shelly1-garage-ext-0/config
2020-09-10 10:46:43 DEBUG (SyncWorker_14) [homeassistant.components.python_script.shellies_discovery.py] Sending to MQTT broker: homeassistant/sensor/shelly1-garage-ext-1/config
2020-09-10 10:46:43 DEBUG (SyncWorker_14) [homeassistant.components.python_script.shellies_discovery.py] Sending to MQTT broker: homeassistant/sensor/shelly1-garage-ext-2/config
2020-09-10 10:46:43 DEBUG (SyncWorker_14) [homeassistant.components.python_script.shellies_discovery.py] Sending to MQTT broker: homeassistant/sensor/shelly1-garage-ext-temperature-0/config {"name": "Shelly 1 garage External Temperature 0", "stat_t": "~ext_temperature/0", "val_tpl": "{%if value != 999%}{{value|float|round(1)}}{%endif%}", "unit_of_meas": "°C", "dev_cla": "temperature", "exp_aft": 43200, "frc_upd": "True", "avty_t": "~online", "pl_avail": "true", "pl_not_avail": "false", "uniq_id": "shelly1-garage-ext-temperature-0", "qos": 0, "dev": {"ids": ["e098069614c9"], "name": "Shelly 1 garage", "mdl": "Shelly 1", "sw": "20200827-065344/v1.8.3@4a8bc427", "mf": "Allterco Robotics"}, "~": "shellies/shelly1-garage/"}
2020-09-10 10:46:43 DEBUG (SyncWorker_14) [homeassistant.components.python_script.shellies_discovery.py] Sending to MQTT broker: homeassistant/sensor/shelly1-garage-ext-temperature-1/config
2020-09-10 10:46:43 DEBUG (SyncWorker_14) [homeassistant.components.python_script.shellies_discovery.py] Sending to MQTT broker: homeassistant/sensor/shelly1-garage-ext-temperature-2/config
2020-09-10 10:46:43 DEBUG (SyncWorker_14) [homeassistant.components.python_script.shellies_discovery.py] Sending to MQTT broker: homeassistant/sensor/shelly1-garage-ext-humidity-0/config {"name": "Shelly 1 garage External Humidity 0", "stat_t": "~ext_humidity/0", "val_tpl": "{%if value!=999%}{{value|float|round(1)}}{%endif%}", "unit_of_meas": "%", "dev_cla": "humidity", "exp_aft": 43200, "frc_upd": "True", "avty_t": "~online", "pl_avail": "true", "pl_not_avail": "false", "uniq_id": "shelly1-garage-ext-humidity-0", "qos": 0, "dev": {"ids": ["e098069614c9"], "name": "Shelly 1 garage", "mdl": "Shelly 1", "sw": "20200827-065344/v1.8.3@4a8bc427", "mf": "Allterco Robotics"}, "~": "shellies/shelly1-garage/"}
2020-09-10 10:46:43 DEBUG (SyncWorker_14) [homeassistant.components.python_script.shellies_discovery.py] Sending to MQTT broker: homeassistant/binary_sensor/shelly1-garage-firmware-update/config {"name": "Shelly 1 garage Firmware Update", "stat_t": "~info", "uniq_id": "shelly1-garage-firmware-update", "qos": 0, "dev": {"ids": ["e098069614c9"], "name": "Shelly 1 garage", "mdl": "Shelly 1", "sw": "20200827-065344/v1.8.3@4a8bc427", "mf": "Allterco Robotics"}, "~": "shellies/shelly1-garage/", "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}}"}

No idea what’s happened…

Weird, it’s important that it works properly now.

1 Like

Yep, I’ll keep an eye on it and see what happens. Thanks very much for your help.

1 Like

Hi. Thank you for your great work.
I have just successfully configured an external temperature probe on a shellypm1 and I find that the values ​​it shows do not match with analog thermometer. Would it be possible to add a “manual calibration” option that modifies the values ​​reported by the device? (e.g. ‘calibration_temp_ext_0: 1’ would add 1 degree to the temperature reported by the device)
Thanks

So far I have no idea how to implement this feature.

New version: 0.30.0

Changelog:

  • add initial support for Shelly UNI
  • use ne device classes, HA 0.115 required