King Of Fans MR101Z missing MAX setting

Do not use speed_count and speeds. Use percentage based speeds.

1 Like

As expected, you’re a genius! That worked!

Now I just need to figure out why when I tell Alexa to set it to ‘breeze’ it starts asking me about my Ecobee thermostat.

I ended up using Node red and seting the fan to 1% on Alexa activates breeze mode. It relies on zigbee2mqtt and a node red Alexa skill though.

Zigbee2mqtt has a pending PR that should fix this template and have all 4 speeds and breeze mode working on the next release for this fan too.

I posted the Node red flow here Unable to get Home Decorator / Hampton Bay Zigbee fan to pair - #18 by mwav3

@flyize sorry for the dumb question but I just made the move to HA and after moving over my KoF’s I also noticed the high fan speed was missing. How do I setup the template and the script for the fan? I currently have 5 KoF’s so I assume I need to do this for each fan?

I don’t know about zha, but in zigbee2mqtt you can control all 4 speeds and smart mode of the fan directly through Home Assistant now. This fan and getting full control was one of the reasons I opted for zigbee2mqtt over zha:

119249329-4e016900-bb5d-11eb-8029-c1d05fb81d0f

The PR was done recently in zigbee2mqtt to fix this - https://github.com/Koenkk/zigbee2mqtt/pull/7359

There are still some minor warnings in Home Assistant though for templating issues - I filed an issue with zigbee2mqtt to hopefully fix it. If not, you can do an MQTT template yourself to clear all the errors. More info on that here - https://github.com/Koenkk/zigbee2mqtt/issues/8617

Welcome! I’d just move this project down your list for right now. While you get up to speed, its going to be like trying to drink from a firehose. Templates took me quite a while to wrap my head around. Hopefully you’ll pick it up quicker. Either way, the docs are here:

@mwav3 thanks for the info but unfortunately my zigbee dongle is not support so that isn’t an option for me.

Thanks @flyize. Sadly I’m not very good with this stuff so its a bit challenging at the moment. Where I’m stuck is where to put the code you have posted above? I assume they need to be pasted into one of the *.yaml files. I’ve tried pasting the code in a couple different yaml files (scripts.yaml, configuration.yaml) and changed the values to match my device but either I put in the wrong place or changed the wrong value or missed something else.

I was able to get this working somewhat. The problem i’m facing is with the fan speed slider. It doesn’t seem to do anything. Looks like this may be the problem as the results are unknown in the template editor. Any ideas on what needs to be changed?

   ` percentage_template: "{{ states('input_number.office_fan_percentage') }}" `
   ` preset_mode_template: "{{ states('input_select.office_fan_preset_mode') }}" `

Configuration > Helpers

Add some new input_numbers.

Are the low, medium, high options totally gone now? Alexa doesn’t seem to know what I’m asking anymore.

(I seem to recall there was a PR for this somewhere…)

Yes, they were removed in the September release. Look on breaking changes under mqtt

1 Like

That says for MQTT though. I’m not using MQTT.

Looks like this PR took it away from everything else for the rest of the fan platform beyond just MQTT

You should be able to setup Three Alexa routines to control the fan, so when you say “Alexa, set bedroom fan to low” - Alexa will recognize that command and translate it to turning the fan on at 33%. Then you do one for medium at 66, high at 100, etc. This is the way I used to do it for an old fan I had so you don’t have to say - “Alexa set fan to 33%”.

1 Like

Oh, that’s not a bad idea. Thanks!

I also noticed that presets for my fan template, like breeze, aren’t working via Alexa. Any ideas on that one?

Maybe you can create an “input boolean” called “smart mode” or something like that, and an automation that activates the breeze mode when the boolean is turned on, and switches back to “normal mode” when the boolean is turned off.

Then you can do an Alexa routine that says “Alexa, set bedroom fan to breeze” that will turn that boolean on.

I’m not 100% sure though if you create an input boolean (which is basically a “virtual switch”) if that would feed through from Home Assistant to Alexa directly. I use a Node Red palette to create Alexa devices which gives me a bit more control on how the things come over into Alexa then Haaska or Nabu Casa does, so if it doesn’t come in, you should be able to give that a try.

Also, if the boolean doesn’t come over, creating a “template switch” might work too

It’s actually something wrong in my template, because presets (like ‘smart’ or ‘on’) work with the default template. I just don’t know what it is.

Try adding a float to the percentage template, and setting a speed count to 4

  - platform: template
    fans:
      zha_fan:
        friendly_name: "ZHA Fan"
        unique_id: "jdfskl435475"
        value_template: "{{ states('fan.bedroomzha') }}"
        percentage_template: "{{ states('input_number.bedroomzha_percentage') | float }}"
        preset_mode_template: "{{ states('input_select.bedroomzha_preset_mode') }}"
        turn_on:
          service: fan.turn_on
          entity_id: fan.bedroomzha
        turn_off:
          - service: fan.turn_off
            entity_id: fan.bedroomzha
          - service: input_number.set_value
            data_template:
              entity_id: input_number.bedroomzha_percentage
              value: 0
        set_percentage:
          service: script.zha_fan_set_percentage
          data:
            percentage: "{{ percentage }}"
        speed_count: 4
        set_preset_mode:
          service: script.zha_fan_set_preset_mode
          data_template:
            preset_mode: "{{ preset_mode }}"
        preset_modes:
          - 'max'
          - 'breeze'

I’ll try it. Thanks.

I also created a thread to request the quirk be officially fixed here:

That didn’t seem to help. @jbouwh any way you might be able to shed some light on how to ‘breeze’ to work for this template?

There is a resolved issue with Alexa where the percentage_step is not an integer.

Further the use of templates for fans is not yet supported yet, but that will be resolved too.

You could use a MQTT fan to test if presets work.

1 Like