Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

'value_template' must be set together with 'state_topic' #34

Open
provinzio opened this issue Jun 24, 2021 · 0 comments · May be fixed by #35
Open

'value_template' must be set together with 'state_topic' #34

provinzio opened this issue Jun 24, 2021 · 0 comments · May be fixed by #35

Comments

@provinzio
Copy link
Contributor

provinzio commented Jun 24, 2021

I updated to the latest am43-ctrl and Home Assistant (supervised) and am now receiving the follow error.
I cannot control the blinds anymore.

Any ideas on this? As far as I can see, state_topic is defined with the MQTT message.

2021-06-24 16:06:08 ERROR (MainThread) [homeassistant.util.logging] Exception in async_discover when dispatching 'mqtt_discovery_new_cover_mqtt': ({'name': '0245f32c8f21', 'command_topic': 'homeassistant/cover/0245f32c8f21/set', 'position_topic': 'homeassistant/cover/0245f32c8f21/state', 'set_position_topic': 'homeassistant/cover/0245f32c8f21/setposition', 'position_open': 0, 'position_closed': 100, 'availability_topic': 'homeassistant/cover/0245f32c8f21/connection', 'payload_available': 'Online', 'payload_not_available': 'Offline', 'payload_open': 'OPEN', 'payload_close': 'CLOSE', 'payload_stop': 'STOP', 'value_template': "{{value_json['position']}}", 'unique_id': 'am43_0245f32c8f21_cover', 'device': {'identifiers': 'am43_0245f32c8f21', 'name': '0245f32c8f21', 'manufacturer': 'Generic AM43'}, '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'.

Further tries to open/close the blinds will throw the error

2021-06-24 16:07:31 WARNING (MainThread) [homeassistant.helpers.service] Unable to find referenced entities cover.0245f32c8f21

I had a second look into the log and the code. It should be regarding the entry at https://github.com/binsentsu/am43-ctrl/blob/master/src/MQTTConnector.js#L51.

@provinzio provinzio linked a pull request Jun 24, 2021 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant