flyize
January 11, 2021, 6:04pm
1
I’m in the process of migrating all my Zigbee devices off SmartThings into HA directly. The fan controllers that I use are missing a fan setting. In HA, I only have low, medium, and high (plus a couple other irrelevant settings).
The actual remote for the fan and SmartThings had low, medium, high, and max. How might I work to get this corrected?
If it matters, this is the fan controller in question:
https://www.homedepot.com/p/Hampton-Bay-Universal-Wink-Enabled-White-Ceiling-Fan-Premier-Remote-Control-99432/206591100
flyize
January 12, 2021, 3:20pm
2
I guess more specifically, do I report this as a bug or feature enhancement? And where do I report it? Is this considered a quirk?
This is the handler I was using in SmartThings:
/**
* King Of Fans Zigbee Fan Controller
*
* To be used with Ceiling Fan Remote Controller Model MR101Z receiver by Chungear Industrial Co. Ltd
* at Home Depot Gardinier 52" Ceiling Fan, Universal Ceiling Fan/Light Premier Remote Model #99432
*
* Copyright 2017 Ranga Pedamallu, Stephan Hackett, Dale Coffing
*
* Contributing Authors:
Ranga Pedamallu; initial release and zigbee parsing mastermind!
Stephan Hackett; new composite (child) device type genius!
Dale Coffing; icons, multiAttribute fan, code maintenance flunky
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
* in compliance with the License. You may obtain a copy of the License at:
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License
This file has been truncated. show original
Hedda
(Hedda)
February 2, 2021, 8:18am
3
1 Like
flyize
February 2, 2021, 8:46pm
4
This is awesome! I see one of them ‘merged’, does this mean it should be coming soon?
Also, is there a way to account for the ‘breeze’ setting, where it randomly cycles up and down? Not sure which thread to ask about that in…
Hedda
(Hedda)
February 3, 2021, 4:37pm
5
flyize
February 4, 2021, 9:15pm
6
@Hedda At the risk of looking like an idiot, who are the devs?
Hedda
(Hedda)
February 5, 2021, 12:06pm
7
flyize:
who are the devs?
First look at any Python programmer/scripter who themselves own or have access to a such kof mr101z fan as personal interest is usually the number one motivator and having access to the specific device most of the time essential. So maybe people who contributed so far? Looks to be Shulyaka, andyzickler, and prairiesnpr?
https://github.com/zigpy/zha-device-handlers/blob/b12ebc37790af34253fce4a0c549d05a8ffb995c/zhaquirks/kof/kof_mr101z.py
dmulcahey and Adminiuga are listed as contributers there too but that is because they are developers of the zha-device-handlers and the zigpy libraries/projects and as such they probably do not own that specific device, however, they might be able to assist other developers who own that device if they need advice.
Update : walthowd also mentioned he has a KoF in Update zha to use new fan entity model by bdraco · Pull Request #45758 · home-assistant/core · GitHub
Again, best is probably to ask nicle once more in King Of Fans MR101Z missing MAX setting · Issue #628 · zigpy/zigpy · GitHub after that Update zha to use new fan entity model by bdraco · Pull Request #45758 · home-assistant/core · GitHub pull request has been merged into Home Assistant
1 Like
Setting the fan to “Smart” will activate the breeze mode.
1 Like
Hedda
(Hedda)
February 18, 2021, 10:39am
9
FYI, the ZHA pull request Update zha to use new fan entity model by bdraco · Pull Request #45758 · home-assistant/core · GitHub for the new fan entity model has now been merged into Home Assistant core.
So I believe that you could now start to look at fan speed quirk for zha-device-handlers of specific models of different fans(?).
That’s something that would need to be added to zha-device-handlers/zhaquirks/kof/kof_mr101z.py at b12ebc37790af34253fce4a0c549d05a8ffb995c · zigpy/zha-device-handlers · GitHub before we could add it in HA.
Note however that some fan speed interpretation inconsistencies in Home Assistant so bdraco is now also working on additional new pull requests for Home Assistant core ( Implement percentage step sizes for fans by bdraco · Pull Request #46512 · home-assistant/core · GitHub and Cleanup inconsistencies in zha fan and make it a bit more dry by bdraco · Pull Request #46714 · home-assistant/core · GitHub ) which will add fan speed procentage interpretation support which in turn will allow for the addition of “fan.increase_speed” and “fan.decrease_speed” commands in Home Assistant. This is really needed for intuitive voice assistant control of fan speeds via Amazon Alexa / Amazon Echo and Google Assistant / Google Home speakers.
Therefor any quirks in zha-device-handlers might have to be updated again later to implement percentage step sizes for all fans.
1 Like
flyize
February 18, 2021, 2:26pm
10
Its great news to see so much movement on this! Wow!
edit: Is there a request that needs to be raised to fix the actual setting of this fan? It seems this would happen in the quirk, correct?
Additionally, anyone have a blog post or other good information on how these quirks are created and solved? I’d sure like to actually be able to help one day.
Hedda
(Hedda)
February 19, 2021, 11:46am
11
1 Like
flyize
March 2, 2021, 2:48pm
12
It doesn’t appear that the issue has been moved. What is proper etiquette? Should I create a new issue in quirks?
Apologies, as clearly I’m new. Thanks for any help.
Hedda
(Hedda)
March 4, 2021, 7:55am
13
Suggest to wait for another weak or so and then try bump that issue by again asking for it to be moved.
You have to understand and remember that everyone contributing to ZHA and zigpy are not getting paid to do so, these are still only hobby projects that people volenteer to work on for free for the fun of it.
1 Like
flyize
March 5, 2021, 1:48pm
14
Oh I totally understand that! I’m trying to temper my excitement and be respectful.
1 Like
flyize
June 16, 2021, 6:24pm
15
I really wish I understood quirks a bit better, I feel like it would almost be easier than what I did. But maybe I think that because I don’t understand quirks.
Anyway, I was able to put together a template and scripts to deal with the new percentages and presets of this fan controller. Figured I’d post it in case anyone else found it helpful.
This is my first template, so there’s probably a ton wrong. I welcome any criticism.
TEMPLATE:
fan:
- platform: template
fans:
office_fan:
friendly_name: "Office fan temp"
unique_id: "jdfskl43443"
value_template: "{{ states('fan.office') }}"
percentage_template: "{{ states('input_number.office_fan_percentage') }}"
preset_mode_template: "{{ states('input_select.office_fan_preset_mode') }}"
turn_on:
service: fan.turn_on
entity_id: fan.office
turn_off:
- service: fan.turn_off
entity_id: fan.office
- service: input_number.set_value
data_template:
entity_id: input_number.office_fan_percentage
value: 0
set_percentage:
service: script.office_fan_set_percentage
data:
percentage: "{{ percentage }}"
set_preset_mode:
service: script.office_fan_set_preset_mode
data_template:
preset_mode: "{{ preset_mode }}"
preset_modes:
- 'max'
- 'breeze'
SCRIPTS:
office_fan_preset_low:
sequence:
- service: input_number.set_value
target:
entity_id: input_number.office_fan_percentage
data:
value: 25
- service: fan.turn_on
data:
percentage: 33
target:
entity_id: fan.office
mode: single
office_fan_preset_medium:
sequence:
- service: input_number.set_value
target:
entity_id: input_number.office_fan_percentage
data:
value: 50
- service: fan.turn_on
data:
percentage: 66
target:
entity_id: fan.office
mode: single
office_fan_preset_high:
sequence:
- service: input_number.set_value
target:
entity_id: input_number.office_fan_percentage
data:
value: 75
- service: fan.turn_on
data:
percentage: 100
target:
entity_id: fan.office
mode: single
office_fan_preset_max:
sequence:
- service: input_number.set_value
target:
entity_id: input_number.office_fan_percentage
data:
value: 100
- service: fan.turn_on
data: {}
target:
entity_id: fan.office
- service: fan.set_preset_mode
target:
entity_id: fan.office
data:
preset_mode: 'on'
mode: single
office_fan_preset_breeze:
sequence:
- service: input_number.set_value
target:
entity_id: input_number.office_fan_percentage
data:
value: 0
- service: fan.turn_on
data: {}
target:
entity_id: fan.office
- service: fan.set_preset_mode
target:
entity_id: fan.office
data:
preset_mode: smart
mode: single
office_fan_set_preset_mode:
sequence:
- service: script.turn_on
data_template:
entity_id: script.office_fan_preset_{{ preset_mode }}
office_fan_set_percentage:
sequence:
- service: input_number.set_value
target:
entity_id: input_number.office_fan_percentage
data_template:
value: '{{ percentage }}'
- choose:
- conditions:
- condition: numeric_state
entity_id: input_number.office_fan_percentage
below: 1
sequence:
- service: fan.turn_off
target:
entity_id: fan.office
- conditions:
- condition: numeric_state
entity_id: input_number.office_fan_percentage
below: 26
sequence:
- service: script.office_fan_preset_low
- conditions:
- condition: numeric_state
entity_id: input_number.office_fan_percentage
below: 51
sequence:
- service: script.office_fan_preset_medium
- conditions:
- condition: numeric_state
entity_id: input_number.office_fan_percentage
below: 76
sequence:
- service: script.office_fan_preset_high
- conditions:
- condition: numeric_state
entity_id: input_number.office_fan_percentage
below: 101
sequence:
- service: script.office_fan_preset_max
default: []
mode: single
office_fan_turn_off:
sequence:
- service: fan.turn_off
target:
entity_id: fan.office
- service: input_number.set_value
target:
entity_id: input_number.office_fan_percentage
data:
value: 0
mode: single
edit: Made a couple of adjustments
1 Like
I had not noticed it was missing a speed, but you are right, it is.
I don’t have any idea how to set this up though.
flyize
July 2, 2021, 5:03pm
17
Okay, updated it again. It now works with Alexa as well, with the exception of my define preset modes: max and breeze.
Anyone know why those don’t work with Alexa?
flyize
July 8, 2021, 2:05pm
18
@jbouwh I see you recently had some PRs merged around fans and Alexa. Any chance you could shed some light on what I’m doing wrong with my presets?
jbouwh
(Jan)
July 8, 2021, 6:37pm
19
There was an issue where legacy speeds still were needed that was solved, have a look at the PR. I also got google Assistant working with fans. The type of the fan does not matter. Speed percentage, preset modes and legacy speeds (at least for a while) should work fine now.
flyize
July 8, 2021, 8:49pm
20
Then my template must be wrong. Any chance you might take a look at it? It’s a couple posts up.