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
[HASS] cover device 'value_template' deprecated? #1327
Comments
Yep, seems that the fix needed is:
|
Thank you very much for the swift response! |
Do I need to clear something to get this working? When rediscovering the node, this is the result: {
"type": "cover",
"object_id": "position",
"values": [
"38-0-currentValue",
"38-0-targetValue"
],
"discovery_payload": {
"command_topic": "zwave/fibaro_fgr222_00/38/0/targetValue/set",
"position_topic": "zwave/fibaro_fgr222_00/38/0/currentValue",
"set_position_topic": "zwave/fibaro_fgr222_00/38/0/targetValue/set",
"value_template": "{{ (value_json.value / 99 * 100) | round(0) }}",
"position_open": 99,
"position_closed": 0,
"payload_open": "99",
"payload_close": "0",
"device": {
"identifiers": [
"zwavejs2mqtt_0xc883eb3e_node18"
],
"manufacturer": "Fibargroup",
"model": "Roller Shutter 2 (FGR222)",
"name": "fibaro_fgr222_00",
"sw_version": "25.25"
},
"name": "fibaro_fgr222_00_position",
"unique_id": "zwavejs2mqtt_0xc883eb3e_Node18_position"
},
"discoveryTopic": "cover/fibaro_fgr222_00/position/config",
"persistent": false,
"ignoreDiscovery": false,
"id": "cover_position"
} As you can see |
I believe there was one entry you may have omitted. |
Thanks for the PR! |
Version
HA 2021.6.3
Run method: Docker
zwavejs2mqtt: 5.0.0
zwave-js: 7.7.3
Describe the bug
Fibaro fgr222 cover 'disappeared' after upgrading HA to 2021.6.3
Resulting in the following error in home assistant:
2021-06-11 00:25:48 ERROR (MainThread) [homeassistant.util.logging] Exception in async_discover when dispatching 'mqtt_discovery_new_cover_mqtt': ({'command_topic': 'zwave/fibaro_fgr222_00/38/0/targetValue/set', 'position_topic': 'zwave/fibaro_fgr222_00/38/0/currentValue', 'set_position_topic': 'zwave/fibaro_fgr222_00/38/0/targetValue/set', 'value_template': '{{ (value_json.value / 99 * 100) | round(0) }}', 'position_open': 99, 'position_closed': 0, 'payload_open': '99', 'payload_close': '0', 'device': {'identifiers': ['zwavejs2mqtt_0xc883eb3e_node18'], 'manufacturer': 'Fibargroup', 'model': 'Roller Shutter 2 (FGR222)', 'name': 'fibaro_fgr222_00', 'sw_version': '25.25'}, 'name': 'fibaro_fgr222_00_position', 'unique_id': 'zwavejs2mqtt_0xc883eb3e_Node18_position', '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'.
Apparently 2021.6.3 breaks mqtt in certain cases:
Source
Based on an issue for zigbee2mqtt, is this something that needs fixing in zwavejs2mqtt?
The text was updated successfully, but these errors were encountered: