Get rid of Dafang integration

Hi All,

In the past i have used the Dafang integration, using MQTT.
I am trying to get rid of it, as far as i can see i have removed it from everywhere, but i keep getting this error in the logs:

Log Details (ERROR)

Logger: homeassistant.util.logging
Source: util/logging.py:105
First occurred: 4:40:16 PM (4 occurrences)
Last logged: 4:40:16 PM

  • Exception in async_discover when dispatching ‘mqtt_discovery_new_cover_mqtt’: ({‘name’: ‘dafang move up/down’, ‘unique_id’: ‘7811dc77bc13-move-up-down’, ‘device’: {‘identifiers’: ‘7811dc77bc13’, ‘connections’: [[‘mac’, ‘78:11:dc:77:bc:13’]], ‘manufacturer’: ‘Xiaomi’, ‘model’: ‘Dafang’, ‘name’: ‘dafang’, ‘sw_version’: ‘2020-11-06T20:28:46Z - master - 02d5523’}, ‘set_position_topic’: ‘home/dafang/motors/vertical/set’, ‘position_topic’: ‘home/dafang/motors/vertical’, ‘command_topic’: ‘home/dafang/motors/vertical/set’, ‘payload_close’: ‘down’, ‘payload_open’: ‘up’, ‘optimistic’: ‘false’, ‘value_template’: ‘{{ ((value|int)/(700/100))|round }}’, ‘set_position_template’: ‘{{ ((position|int)*(700/100))|round }}’, ‘platform’: ‘mqtt’},) Traceback (most recent call last): 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 817, in validate_callable return schema(data) File “/usr/src/homeassistant/homeassistant/components/mqtt/cover.py”, line 118, in validate_options raise vol.Invalid( voluptuous.error.Invalid: ‘value_template’ must be set together with ‘state_topic’. During handling of the above exception, another exception occurred: Traceback (most recent call last): File “/usr/src/homeassistant/homeassistant/components/mqtt/mixins.py”, line 160, in async_discover config = schema(discovery_payload) File “/usr/local/lib/python3.8/site-packages/voluptuous/validators.py”, line 218, in call return self._exec((Schema(val) for val in self.validators), v) File “/usr/local/lib/python3.8/site-packages/voluptuous/validators.py”, line 341, in _exec raise e if self.msg is None else AllInvalid(self.msg, path=path) File “/usr/local/lib/python3.8/site-packages/voluptuous/validators.py”, line 337, in _exec v = func(v) File “/usr/local/lib/python3.8/site-packages/voluptuous/schema_builder.py”, line 276, in call raise er.MultipleInvalid([e]) voluptuous.error.MultipleInvalid: ‘value_template’ must be set together with ‘state_topic’.
  • Exception in async_discover when dispatching ‘mqtt_discovery_new_cover_mqtt’: ({‘name’: ‘dafang move left/right’, ‘unique_id’: ‘7811dc77bc13-move-left-right’, ‘device’: {‘identifiers’: ‘7811dc77bc13’, ‘connections’: [[‘mac’, ‘78:11:dc:77:bc:13’]], ‘manufacturer’: ‘Xiaomi’, ‘model’: ‘Dafang’, ‘name’: ‘dafang’, ‘sw_version’: ‘2020-11-06T20:28:46Z - master - 02d5523’}, ‘set_position_topic’: ‘home/dafang/motors/horizontal/set’, ‘position_topic’: ‘home/dafang/motors/horizontal’, ‘command_topic’: ‘home/dafang/motors/horizontal/set’, ‘payload_close’: ‘right’, ‘payload_open’: ‘left’, ‘optimistic’: ‘false’, ‘value_template’: ‘{{ ((value|int)/(2600/100))|round }}’, ‘set_position_template’: ‘{{ ((position|int)*(2600/100))|round }}’, ‘platform’: ‘mqtt’},) Traceback (most recent call last): 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 817, in validate_callable return schema(data) File “/usr/src/homeassistant/homeassistant/components/mqtt/cover.py”, line 118, in validate_options raise vol.Invalid( voluptuous.error.Invalid: ‘value_template’ must be set together with ‘state_topic’. During handling of the above exception, another exception occurred: Traceback (most recent call last): File “/usr/src/homeassistant/homeassistant/components/mqtt/mixins.py”, line 160, in async_discover config = schema(discovery_payload) File “/usr/local/lib/python3.8/site-packages/voluptuous/validators.py”, line 218, in call return self._exec((Schema(val) for val in self.validators), v) File “/usr/local/lib/python3.8/site-packages/voluptuous/validators.py”, line 341, in _exec raise e if self.msg is None else AllInvalid(self.msg, path=path) File “/usr/local/lib/python3.8/site-packages/voluptuous/validators.py”, line 337, in _exec v = func(v) File “/usr/local/lib/python3.8/site-packages/voluptuous/schema_builder.py”, line 276, in call raise er.MultipleInvalid([e]) voluptuous.error.MultipleInvalid: ‘value_template’ must be set together with ‘state_topic’.
  • Exception in async_discover when dispatching ‘mqtt_discovery_new_cover_mqtt’: ({‘name’: ‘Garage move up/down’, ‘unique_id’: ‘7811dc77bc13-move-up-down’, ‘device’: {‘identifiers’: ‘7811dc77bc13’, ‘connections’: [[‘mac’, ‘78:11:dc:77:bc:13’]], ‘manufacturer’: ‘Xiaomi’, ‘model’: ‘Dafang’, ‘name’: ‘Garage’, ‘sw_version’: ‘2020-11-06T20:28:46Z - master - 02d5523’}, ‘set_position_topic’: ‘home/Garage/motors/vertical/set’, ‘position_topic’: ‘home/Garage/motors/vertical’, ‘command_topic’: ‘home/Garage/motors/vertical/set’, ‘payload_close’: ‘down’, ‘payload_open’: ‘up’, ‘optimistic’: ‘false’, ‘value_template’: ‘{{ ((value|int)/(700/100))|round }}’, ‘set_position_template’: ‘{{ ((position|int)*(700/100))|round }}’, ‘platform’: ‘mqtt’},) Traceback (most recent call last): 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 817, in validate_callable return schema(data) File “/usr/src/homeassistant/homeassistant/components/mqtt/cover.py”, line 118, in validate_options raise vol.Invalid( voluptuous.error.Invalid: ‘value_template’ must be set together with ‘state_topic’. During handling of the above exception, another exception occurred: Traceback (most recent call last): File “/usr/src/homeassistant/homeassistant/components/mqtt/mixins.py”, line 160, in async_discover config = schema(discovery_payload) File “/usr/local/lib/python3.8/site-packages/voluptuous/validators.py”, line 218, in call return self._exec((Schema(val) for val in self.validators), v) File “/usr/local/lib/python3.8/site-packages/voluptuous/validators.py”, line 341, in _exec raise e if self.msg is None else AllInvalid(self.msg, path=path) File “/usr/local/lib/python3.8/site-packages/voluptuous/validators.py”, line 337, in _exec v = func(v) File “/usr/local/lib/python3.8/site-packages/voluptuous/schema_builder.py”, line 276, in call raise er.MultipleInvalid([e]) voluptuous.error.MultipleInvalid: ‘value_template’ must be set together with ‘state_topic’.
  • Exception in async_discover when dispatching ‘mqtt_discovery_new_cover_mqtt’: ({‘name’: ‘Garage move left/right’, ‘unique_id’: ‘7811dc77bc13-move-left-right’, ‘device’: {‘identifiers’: ‘7811dc77bc13’, ‘connections’: [[‘mac’, ‘78:11:dc:77:bc:13’]], ‘manufacturer’: ‘Xiaomi’, ‘model’: ‘Dafang’, ‘name’: ‘Garage’, ‘sw_version’: ‘2020-11-06T20:28:46Z - master - 02d5523’}, ‘set_position_topic’: ‘home/Garage/motors/horizontal/set’, ‘position_topic’: ‘home/Garage/motors/horizontal’, ‘command_topic’: ‘home/Garage/motors/horizontal/set’, ‘payload_close’: ‘right’, ‘payload_open’: ‘left’, ‘optimistic’: ‘false’, ‘value_template’: ‘{{ ((value|int)/(2600/100))|round }}’, ‘set_position_template’: ‘{{ ((position|int)*(2600/100))|round }}’, ‘platform’: ‘mqtt’},) Traceback (most recent call last): 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 817, in validate_callable return schema(data) File “/usr/src/homeassistant/homeassistant/components/mqtt/cover.py”, line 118, in validate_options raise vol.Invalid( voluptuous.error.Invalid: ‘value_template’ must be set together with ‘state_topic’. During handling of the above exception, another exception occurred: Traceback (most recent call last): File “/usr/src/homeassistant/homeassistant/components/mqtt/mixins.py”, line 160, in async_discover config = schema(discovery_payload) File “/usr/local/lib/python3.8/site-packages/voluptuous/validators.py”, line 218, in call return self._exec((Schema(val) for val in self.validators), v) File “/usr/local/lib/python3.8/site-packages/voluptuous/validators.py”, line 341, in _exec raise e if self.msg is None else AllInvalid(self.msg, path=path) File “/usr/local/lib/python3.8/site-packages/voluptuous/validators.py”, line 337, in _exec v = func(v) File “/usr/local/lib/python3.8/site-packages/voluptuous/schema_builder.py”, line 276, in call raise er.MultipleInvalid([e]) voluptuous.error.MultipleInvalid: ‘value_template’ must be set together with ‘state_topic’.

Not sure if this was ever solved, but it is because the Dafang MQTT messages are retained. See this thread’s solution on an easy way to remove retained messages.