jbouwh
(Jan)
July 9, 2021, 12:07pm
21
Do not use speed_count
and speeds. Use percentage based speeds.
1 Like
flyize
July 9, 2021, 2:19pm
22
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.
mwav3
(Tim)
July 30, 2021, 12:48am
23
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?
mwav3
(Tim)
September 7, 2021, 1:08pm
25
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:
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
flyize
September 7, 2021, 5:12pm
26
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') }}" `
flyize
September 8, 2021, 3:04pm
29
Configuration > Helpers
Add some new input_numbers.
flyize
October 21, 2021, 7:13pm
30
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 …)
mwav3
(Tim)
October 21, 2021, 9:00pm
31
Yes, they were removed in the September release. Look on breaking changes under mqtt
Adding home battery and gas support to the Energy dashboard and show data for different time periods, more long-term statistics, USB discovery, and more advanced templating features
home-assistant:dev
← jbouwh:mqtt-fan-remove-speeds
opened 04:06PM - 17 Aug 21 UTC
<!--
You are amazing! Thanks for contributing to our project!
Please, DO N… OT DELETE ANY TEXT from this template! (unless instructed).
-->
## Breaking change
<!--
If your PR contains a breaking change for existing users, it is important
to tell them what breaks, how to make it work again and why we did this.
This piece of text is published with the release notes, so it helps if you
write it towards our users, not us.
Note: Remove this section if this PR is NOT a breaking change.
-->
MQTT fan no longer supports Support for legacy speeds (OFF, LOW, MEDIUM, HIGH).
With release 2021.3 the support for legacy speeds was announced to be removed after a quater (2021.7).
With removing the legacy speeds support, integrations that rely on MQTT fan platform that still use legacy speeds would break because they can not be setup if deprecated attributes are used. This includes the MQTT auto discovery.
To prevent that these integration will fail to setup, the deprecated attributes listed here are still allowed in the config:
`payload_high_speed`, `payload_low_speed`, `payload_medium_speed`, `speed_command_topic`, `speeds`, `speed_state_topic`, `speed_value_template`
## Proposed change
<!--
Describe the big picture of your changes here to communicate to the
maintainers why we should accept this pull request. If it fixes a bug
or resolves a feature request, be sure to link to that issue in the
additional information section.
-->
Remove the deprecated support for legacy speeds for the MQTT Fan platform from 2012.9.0.
We silently ignore incorrectly configured devices only telling the settings deprecated and are to be removed from the config.
To regain support for speeds users nee to implement percentage based speeds or preset modes.
## Type of change
<!--
What type of change does your PR introduce to Home Assistant?
NOTE: Please, check only 1! box!
If your PR requires multiple boxes to be checked, you'll most likely need to
split it into multiple PRs. This makes things easier and faster to code review.
-->
- [ ] Dependency upgrade
- [ ] Bugfix (non-breaking change which fixes an issue)
- [ ] New integration (thank you!)
- [ ] New feature (which adds functionality to an existing integration)
- [x] Breaking change (fix/feature causing existing functionality to break)
- [x] Code quality improvements to existing code or addition of tests
## Additional information
<!--
Details are important, and help maintainers processing your PR.
Please be sure to fill out additional details, if applicable.
-->
- This PR fixes or closes issue: fixes #
- This PR is related to issue:
- Link to documentation pull request:
## Checklist
<!--
Put an `x` in the boxes that apply. You can also fill these out after
creating the PR. If you're unsure about any of them, don't hesitate to ask.
We're here to help! This is simply a reminder of what we are going to look
for before merging your code.
-->
- [x] The code change is tested and works locally.
- [x] Local tests pass. **Your PR cannot be merged unless tests pass**
- [x] There is no commented out code in this PR.
- [x] I have followed the [development checklist][dev-checklist]
- [x] The code has been formatted using Black (`black --fast homeassistant tests`)
- [x] Tests have been added to verify that the new code works.
If user exposed functionality or configuration variables are added/changed:
- [ ] Documentation added/updated for [www.home-assistant.io][docs-repository]
If the code communicates with devices, web services, or third-party tools:
- [ ] The [manifest file][manifest-docs] has all fields filled out correctly.
Updated and included derived files by running: `python3 -m script.hassfest`.
- [ ] New or updated dependencies have been added to `requirements_all.txt`.
Updated by running `python3 -m script.gen_requirements_all`.
- [ ] Untested files have been added to `.coveragerc`.
The integration reached or maintains the following [Integration Quality Scale][quality-scale]:
<!--
The Integration Quality Scale scores an integration on the code quality
and user experience. Each level of the quality scale consists of a list
of requirements. We highly recommend getting your integration scored!
-->
- [ ] No score or internal
- [ ] 🥈 Silver
- [ ] 🥇 Gold
- [ ] 🏆 Platinum
<!--
This project is very active and we have a high turnover of pull requests.
Unfortunately, the number of incoming pull requests is higher than what our
reviewers can review and merge so there is a long backlog of pull requests
waiting for review. You can help here!
By reviewing another pull request, you will help raise the code quality of
that pull request and the final review will be faster. This way the general
pace of pull request reviews will go up and your wait time will go down.
When picking a pull request to review, try to choose one that hasn't yet
been reviewed.
Thanks for helping out!
-->
To help with the load of incoming pull requests:
- [ ] I have reviewed two other [open pull requests][prs] in this repository.
[prs]: https://github.com/home-assistant/core/pulls?q=is%3Aopen+is%3Apr+-author%3A%40me+-draft%3Atrue+-label%3Awaiting-for-upstream+sort%3Acreated-desc+review%3Anone
<!--
Thank you for contributing <3
Below, some useful links you could explore:
-->
[dev-checklist]: https://developers.home-assistant.io/docs/en/development_checklist.html
[manifest-docs]: https://developers.home-assistant.io/docs/en/creating_integration_manifest.html
[quality-scale]: https://developers.home-assistant.io/docs/en/next/integration_quality_scale_index.html
[docs-repository]: https://github.com/home-assistant/home-assistant.io
1 Like
flyize
October 22, 2021, 1:05pm
32
That says for MQTT though. I’m not using MQTT.
mwav3
(Tim)
October 22, 2021, 1:22pm
33
Looks like this PR took it away from everything else for the rest of the fan platform beyond just MQTT
home-assistant:dev
← jbouwh:alexa-remove-fan-legacy-speed
opened 07:05PM - 24 Aug 21 UTC
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
flyize
October 22, 2021, 1:34pm
34
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?
mwav3
(Tim)
October 22, 2021, 1:40pm
35
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
flyize
October 22, 2021, 1:44pm
36
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.
mwav3
(Tim)
October 22, 2021, 7:12pm
37
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'
flyize
October 22, 2021, 7:24pm
38
I’ll try it. Thanks.
I also created a thread to request the quirk be officially fixed here:
opened 07:24PM - 22 Oct 21 UTC
Is your feature request related to a problem? Please describe.
This quirk could use an update to fully match the new fan...
flyize
October 25, 2021, 2:43pm
39
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?
jbouwh
(Jan)
October 25, 2021, 3:29pm
40
There is a resolved issue with Alexa where the percentage_step is not an integer.
home-assistant:dev
← jbouwh:alexa-speed_step-precision-issue
opened 08:45PM - 19 Oct 21 UTC
Further the use of templates for fans is not yet supported yet, but that will be resolved too.
home-assistant:dev
← jbouwh:template-fan-preset_mode-capability
opened 09:32PM - 19 Oct 21 UTC
You could use a MQTT fan to test if presets work.
1 Like