StyraHem / ShellyForHASS

Shelly smart home platform for Home Assistant
MIT License
620 stars 111 forks source link

[BUG] Shelly Motion set up error #543

Open jpearce73 opened 3 years ago

jpearce73 commented 3 years ago

Environment

Describe the bug

Error in the Log

But I would note that the sensor appears to work well despite the log error. I am only looking at the light sensor and motion detector at the moment.

Steps to Reproduce

configuration.yaml looks like this

shelly:
  version: true
  sensors:
    - all
  discover_by_ip:
    - 192.XX.XX.XX
    - 192.XX.XX.XX

Expected behavior

Screenshots

Traceback/Error logs

2021-03-28 20:41:29 ERROR (MainThread) [homeassistant.config_entries] Error setting up entry shellymotionsensor-60A4239921E2 for shelly
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/config_entries.py", line 239, in async_setup
result = await component.async_setup_entry(hass, self) # type: ignore
File "/config/custom_components/shelly/__init__.py", line 84, in async_setup_entry
conf = CONFIG_SCHEMA_ROOT(data)
File "/usr/local/lib/python3.8/site-packages/voluptuous/schema_builder.py", line 272, in __call__
return self._compiled([], data)
File "/usr/local/lib/python3.8/site-packages/voluptuous/schema_builder.py", line 594, in validate_dict
return base_validate(path, iteritems(data), out)
File "/usr/local/lib/python3.8/site-packages/voluptuous/schema_builder.py", line 432, in validate_mapping
raise er.MultipleInvalid(errors)
voluptuous.error.MultipleInvalid: extra keys not allowed @ data['host']

Additional context

mathewmeconry commented 3 years ago

I get the same error for a shelly 2.5 in roller mode with mqtt connection:

2021-04-07 16:09:35 ERROR (MainThread) [homeassistant.util.logging] Exception in async_discover when dispatching 'mqtt_discovery_new_sensor_mqtt': ({'name': 'Shelly 2.5 98F4ABF3F16B Voltage', 'state_topic': 'shellies/shellyswitch25-98F4ABF3F16B/info', 'force_update': 'False', 'en': 'True', 'unique_id': 'shellyswitch25-98f4abf3f16b-voltage', 'qos': 0, 'device': {'identifiers': ['98f4abf3f16b'], 'name': 'Shelly 2.5 98F4ABF3F16B', 'model': 'Shelly 2.5', 'sw_version': '20210323-104714/v1.10.1-gf276b51', 'manufacturer': 'Allterco Robotics'}, 'unit_of_measurement': 'V', 'device_class': 'voltage', 'value_template': '{{value_json.voltage|float|round(1)}}', 'availability_topic': 'shellies/shellyswitch25-98F4ABF3F16B/online', 'payload_available': 'true', 'payload_not_available': 'false', 'platform': 'mqtt'},)
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/mqtt/mixins.py", line 152, in async_discover
    config = schema(discovery_payload)
  File "/usr/local/lib/python3.8/site-packages/voluptuous/schema_builder.py", line 272, in __call__
    return self._compiled([], data)
  File "/usr/local/lib/python3.8/site-packages/voluptuous/schema_builder.py", line 594, in validate_dict
    return base_validate(path, iteritems(data), out)
  File "/usr/local/lib/python3.8/site-packages/voluptuous/schema_builder.py", line 432, in validate_mapping
    raise er.MultipleInvalid(errors)
voluptuous.error.MultipleInvalid: extra keys not allowed @ data['en']

Edit: Resolved after reinstalling HomeAssistant

hakana commented 3 years ago

@jpearce73 Look like you have "host" in your config that is not allowed. Maybe you have something more below in your config.yaml

hakana commented 3 years ago

@mathewmeconry That logdoes not have anything to do with ShellyForHasss as I can see.

jpearce73 commented 3 years ago

Hello and thanks for the reply.

By host do you mean the discover-by-ip section? I posted my entire section for "shelly: " => I confirmed that removing discover-by-ip removes this error message. Also confirmed on my router that the two addresses that I listed are correct (i.e. I didnt just list a bad address).

I followed this documentation, perhaps this id deprecated? https://github.com/StyraHem/ShellyForHASS#discovery-by-ip

hakana commented 3 years ago

Do you have the word host on other places i config.yaml? For me it more look like you have an error in your config file.