I wrote an integration thing-a-ma-bob that uses MQTT to control covers. I’m getting error messages in the logs and I need help understand what could be wrong.
The error message is:
Logger: homeassistant.components.mqtt.cover
Source: components/mqtt/cover.py:372
Integration: MQTT (documentation, issues)
First occurred: 08:27:03 (12 occurrences)
Last logged: 08:27:03
Payload is not supported (e.g. open, closed, opening, closing, stopped): "Stop"
It could be that I’m understanding the documentation incorrectly but in the MQTT discovery cover documentation there is “state_topic” which I point to my topic with the values. It also says State topic can only read (open, opening, closed, closing or stopped) state.
which is clearly where the error is coming from. I do not have those values. I have values “Up”, “Down”, and “Stop”. So I also fill out state_opening: Up
, state_closing: Down
and state_stopped: Stop
which I would assume HASSIO would then use those values to map the state and not the ones required. Am I understanding this incorrectly? If so then what is the purpose of the state_ options?
Here is an example of the config I send
{
"name": "Office Blinds",
"command_topic": "smartfriends2mqtt/sf_11716/rollingShutter/set",
"state_topic": "smartfriends2mqtt/sf_11716/state",
"qos": 0,
"availability": {
"topic": "smartfriends2mqtt/bridge/state"
},
"device": {
"identifiers": [
"sf_11716"
],
"manufacturer": "Alfred Schellenberg GmbH",
"model": "RollingShutter",
"name": "Office Blinds",
"via_device": "SmartFriendsBox"
},
"device_class": "shutter",
"json_attributes_topic": "smartfriends2mqtt/sf_11716",
"unique_id": "sf_11716_cover_smartfriends2mqtt",
"position_topic": "smartfriends2mqtt/sf_11716/position",
"position_template": "{{ 100 - value | int }}",
"set_position_topic": "smartfriends2mqtt/sf_11716/position/set",
"set_position_template": "{{ 100 - position }}",
"state_stopped": "Stop",
"state_opening": "Up",
"state_closing": "Down",
"payload_stop": "Stop",
"payload_open": "Up",
"payload_close": "Down"
}