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

Set range of fan speeds #358

Closed
radiocolin opened this issue Nov 6, 2020 · 3 comments
Closed

Set range of fan speeds #358

radiocolin opened this issue Nov 6, 2020 · 3 comments

Comments

@radiocolin
Copy link

I think the HomeKit API allows this, and if so, it would be great if we could specify the range of fan speeds as a configuration element, rather than only having 0-100. My fan uses 1 to 6 for its speeds.

@fearlesschicken
Copy link

I would like this feature as well. I have a tasmota fan and have different speeds that can be read/set via different payloads.

@arachnetech
Copy link
Owner

Homekit doesn't like having its minimum and maximum rotation speeds set to ranges very different to 0-100. I would instead recommend something like:

        {
            "type": "fan",
            "name": "Test Fan",
            "url": "mqtt://192.168.10.35:1883",
            "logMqtt": true,
            "topics": {
                "getRotationDirection": "test/fan/getRotationDirection",
                "setRotationDirection": "test/fan/setRotationDirection",
                "setOn": "test/fan/setOn",
                "setRotationSpeed": {
                    "topic": "test/fan/setRotationSpeed",
                    "apply": "return 1 + Math.round(message/20)"
                }
            },
            "integerValue": true,
            "accessory": "mqttthing"
        }

... to convert the standard 0-100 range to 1-6.

@rbswift
Copy link
Contributor

rbswift commented Dec 28, 2020

Thanks so much for making this change. It works great with Tasmota and I can remove a dedicated plugin now! Here's my Tasmota config in case anyone comes looking for one:

        {
            "accessory": "mqttthing",
            "type": "fan",
            "name": "Lounge Ceiling Fan",
            "topics": {
                "setRotationSpeed": {
                    "topic": "cmnd/loungefan/fanspeed",
                    "apply": "return (Math.round(message/100*3))"
                },
                "getRotationSpeed": {
                    "topic": "stat/loungefan/RESULT",
                    "apply": "return (Math.round(JSON.parse(message).FanSpeed/3*100))"
                }
            }
        },

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

No branches or pull requests

4 participants