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 Fan - Issues with speed list #28804

Closed
kuchel77 opened this issue Nov 16, 2019 · 4 comments
Closed

MQTT Fan - Issues with speed list #28804

kuchel77 opened this issue Nov 16, 2019 · 4 comments

Comments

@kuchel77
Copy link
Contributor

Home Assistant release with the issue:

Home Assistant 0.101.3

Last working Home Assistant release (if known):

Operating environment (Hass.io/Docker/Windows/etc.):
Docker

Integration:

https://www.home-assistant.io/integrations/fan.mqtt/

Description of problem:

If you include a speed list for MQTT fan, and include off in the speed list, it comes up as a false setting. If you don't include a speed list at all, it comes up with off, low, medium, high. If

Problem-relevant configuration.yaml entries and (fill out even if it seems unimportant):

fan:
  - platform: mqtt
    name: "Living Room Fan"
    state_topic: "fan/status/living/power"
    command_topic: "fan/cmnd/living/power"
    speed_state_topic: "fan/status/living/speed"
    speed_command_topic: "fan/cmnd/living/speed"

Works fine. Gives the full list.

Screen Shot 2019-11-16 at 11 10 19 am

fan:
  - platform: mqtt
    name: "Living Room Fan"
    state_topic: "fan/status/living/power"
    command_topic: "fan/cmnd/living/power"
    speed_state_topic: "fan/status/living/speed"
    speed_command_topic: "fan/cmnd/living/speed"
    speeds:
      - off
      - low
      - high

This gives an error for off. It then changes the off speed to false. (Ignore any formatting errors in that list as I have typed it in manually after deleting it to check things. The formatting is correcting in the actual yaml file).

Screen Shot 2019-11-16 at 11 18 46 am

fan:
  - platform: mqtt
    name: "Living Room Fan"
    state_topic: "fan/status/living/power"
    command_topic: "fan/cmnd/living/power"
    speed_state_topic: "fan/status/living/speed"
    speed_command_topic: "fan/cmnd/living/speed"
    speeds:
      - low
      - high

This gives the third screenshot, where the speeds are just low and high.
Screen Shot 2019-11-16 at 11 25 08 am

According to the documentation, off is a valid speed, but it doesn't seem to be when you put it in the yaml file.

Traceback (if applicable):


Additional information:

@probot-home-assistant
Copy link

Hey there @home-assistant/core, mind taking a look at this issue as its been labeled with a integration (mqtt) you are listed as a codeowner for? Thanks!

@exxamalte
Copy link
Contributor

Unfortunately off is interpreted as a boolean and then transformed into false.

Not sure if an actual fix is possible, but in the meantime a workaround is:

    speeds:
      - "off"
      - low
      - medium
      - high

@kuchel77
Copy link
Contributor Author

I have updated the documentation to show how it can be fixed.

frenck pushed a commit to home-assistant/home-assistant.io that referenced this issue Nov 23, 2019
* Update fan.mqtt.markdown

Update of the documentation. Based on home-assistant/core#28804 

Otherwise homekit for instance will crash if you don't have "off".

* ✏️ Tweak


Co-authored-by: Klaas Schoute <klaas_schoute@hotmail.com>
@springstan
Copy link
Member

I agree with @exxamalte that an actual fix is not possible since the automatic converting would have to be turned off generally and that would lead to other issues. YAML automatically converts some keys to boolean values, for more details take a look at the documentation.

@kuchel77 therefore please close this issue since it has been resolved, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants