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

MQTT cover component: Retain messages are not working. #3497

Closed
nunojusto opened this issue Sep 23, 2016 · 3 comments · Fixed by #3519
Closed

MQTT cover component: Retain messages are not working. #3497

nunojusto opened this issue Sep 23, 2016 · 3 comments · Fixed by #3519

Comments

@nunojusto
Copy link

Home Assistant release (hass --version):
0.28.2

Python release (python3 --version):
Python 3.4.2

Component/platform:
cover MQTT

Description of problem:
MQTT cover component: Retain messages are not working.
If i click the buttons on the home Assistant front-end it does not produce a retained message. Only send a normal message.

I've tested the switch mqtt component with a similar config and it does send a retained message.
So this must be a bug introduced when component code was migrated from rollershutter to cover.

Expected:
The MQTT messages to be retained

Problem-relevant configuration.yaml entries and steps to reproduce:

1- Create this cover
my config is

cover Blinds:
  - platform: mqtt
    name: "Room 1"
    command_topic: "blinds/control/room1"
    qos: 1
    retain: true
    payload_open: "UP"
    payload_stop: "STOP"
    payload_close: "DOWN"

2- execute mosquitto command to subscibe to all messages
mosquitto_sub -h 127.0.0.1 -v -t '#'

3- Click on the cover button (up, down, or stop)
4- The message appears on the mosquitto command, but if we CTRL+C the command and run again. It should appear again because the message was supposed to be retained. And it's not :(

Note: MQTT switch component works fine, so you can follow the behaviour configuring one MQTT switch

Additional info:

@MartinHjelmare
Copy link
Member

I have a fix and will make a PR as soon as tests are written.

@nunojusto
Copy link
Author

Great. Thx Martin

@MartinHjelmare
Copy link
Member

MartinHjelmare commented Sep 27, 2016

The underlying cause was that the retain key had been duplicated in the voluptuous validation schema, when extending the schema, which is a bug in voluptuous:
alecthomas/voluptuous#219
alecthomas/voluptuous#192

@home-assistant home-assistant locked and limited conversation to collaborators Mar 17, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants