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

FanLight not allowing speed change #118

Closed
AndrewJ1990 opened this issue Jul 29, 2020 · 8 comments · Fixed by #267
Closed

FanLight not allowing speed change #118

AndrewJ1990 opened this issue Jul 29, 2020 · 8 comments · Fixed by #267
Assignees
Labels
bug Something isn't working

Comments

@AndrewJ1990
Copy link

Checklist

  • [Y] I have read the common issues wiki page
  • Y ] I have checked to make sure the plugin is up to date

Describe the bug
"FanLight" accessory is not allowing me to change fan speed from HomeKit app. When the fan is turned on despite what the percentage is the fan runs at 100%. Controlling the fan in the Homebridge Config UI web page works as it should.

To Reproduce
Steps to reproduce the behavior:
Attempt to adjust fan speed through HomeKit.

Expected behavior
A clear and concise description of what you expected to happen.
Fan speed should be either 1, 2 or 3

Screenshots
If applicable, add screenshots to help explain your problem.
N/A

Environment (please complete the following information):

  • OS:
  • iOS version:
  • Homehubs:
  • Node Version:
  • Plugin Version:
  • Accessory Type

Additional context
Schema for fan:
name: 'Media Switch',
id: '0814565698f4abec0a31',
key: '...',
def: {
schema: '[{"mode":"rw","code":"switch","name":"\u98ce\u6247\u5f00\u5173","property":{"type":"bool"},"iconname":"icon-power","id":1,"type":"obj","desc":""},{"mode":"rw","code":"fan_speed","name":"\u98ce\u901f\u6863\u4f4d","property":{"range":["1","2","3"],"type":"enum"},"iconname":"icon-a_fan_low","id":3,"type":"obj","desc":"1\u30012\u30013\u5206\u522b\u4ee3\u8868\u4f4e\u3001\u4e2d\u3001\u9ad8\u98ce\u901f\u6863"},{"mode":"rw","code":"light","name":"\u706f\u5f00\u5173","property":{"type":"bool"},"iconname":"icon-tcl_function_light","id":9,"type":"obj","desc":""},{"mode":"rw","code":"master","name":"\u603b\u5f00\u5173","property":{"type":"bool"},"id":101,"type":"obj","desc":"\u706f\u548c\u98ce\u6247\u7684\u603b\u5f00\u5173"},{"mode":"rw","code":"timer_fan","name":"\u98ce\u6247\u5012\u8ba1\u65f6","property":{"range":["1","2","3","4","5"],"type":"enum"},"id":102,"type":"obj","desc":"1 \u8868\u793a\u65e0\u6548\uff0c2\u30013\u30014\u30015 \u5206\u522b\u8868\u793a\u5012\u8ba1\u65f6 1h\u30012h\u30014h\u30018h"},{"mode":"rw","code":"timer_light","name":"\u706f\u5012\u8ba1\u65f6","property":{"range":["1","2","3","4","5"],"type":"enum"},"id":103,"type":"obj","desc":"1 \u8868\u793a\u65e0\u6548\uff0c2\u30013\u30014\u30015 \u5206\u522b\u8868\u793a\u5012\u8ba1\u65f6 1h\u30012h\u30014h\u30018h"}]',
extras: '[{"complexType":"","id":1,"inputStyle":"","inputType":""},{"complexType":"","id":3,"inputStyle":"","inputType":""},{"complexType":"","id":9,"inputStyle":"","inputType":""},{"complexType":"","id":101,"inputStyle":"","inputType":""},{"complexType":"","id":102,"inputStyle":"","inputType":""},{"complexType":"","id":103,"inputStyle":"","inputType":""}]',

config file

{
"name": "Media Room",
"type": "FanLight",
"manufacturer": "Deta Fan Switch",
"model": "Deta",
"id": "0814565698f4abec0a31",
"key": "...",
"dpActive": 1,
"dpRotationSpeed": 3,
"dpLightOn": 9,
"dpBrightness": 10
},

@AndrewJ1990 AndrewJ1990 added the bug Something isn't working label Jul 29, 2020
@stibbzy
Copy link

stibbzy commented Aug 11, 2020

I have the same fan controller (Deta), and I'm getting the same issue. Fan runs at full speed, even when set to a lower speed using fan control slider in Home app.

@stibbzy
Copy link

stibbzy commented Aug 12, 2020

For what it’s worth, the issue seems to be that the fan is instructed to turn on at the same time as it is instructed to set a fan speed. You can see the fan switch light blink when changing speeds in the Home app, which doesn’t happen when using the wall button manually.

I’ve got it mostly working by commenting out the setActive part of the code in SimpleFanLightAccessory.js. This allows Home app and Siri control for fan speed adjustments (including zero speed for off), but you can’t just touch the tile to turn the fan on and off, nor can you ask Siri to just turn the fan on or off.

More investigations to do.

@AndrewJ1990
Copy link
Author

@stibbzy That's what's I've figured out as well, it sending the setActive when you change the speed in HomeKit. Appreciate your work in helping with this. I'm still learning heaps about how this all works

@stibbzy
Copy link

stibbzy commented Aug 19, 2020

Hi @AndrewJ1990 , @iRayanKhan Yep, it works fundamentally differently to the Brilliant fan, in that whenever setActive is sent, the fan will turn on full speed. Attached is the best I can do with my limited coding knowledge (renamed to .txt). It will allow fan speed changes with the home app slider and Siri, and also allow you to turn OFF the fan from the app and Siri, but you can't turn it ON (but you can use the slider to turn it on). I've also changed the dimmable light to a switch, as the Data unit doesn't support dimming.

Unfortunately, I'm not skilled enough to know how to check for variable conditions external to the function (like, if rotation speed is more than 0, then ignore setActive request). For some reason, the status of the fan updates a lot slower than the light as well.

@murch1 has just responded to my initial request for help over at the original home bridge-tuya-lan page (he developed the initial Brilliant fan controller support), hopefully he can add some advice: AMoo-Miki/homebridge-tuya-lan#148
SimpleFanLightAccessory.txt

@stibbzy
Copy link

stibbzy commented Aug 31, 2020

Hi @iRayanKhan
If you had a chance, could you take a look at my text file above and see if there is anything simple that can be done to fix the speed control issue with Deta fan controllers? We just need to prevent the code setting setActive to true every time the rotation speed is changed. My text file is a hack job to prevent setActive from ever being set true, but this means you can’t turn the fan on from the Home app file. The only way to make it operate is to select a fan speed.
Thanks so much,
Mark.

@ElphaX
Copy link
Contributor

ElphaX commented Apr 25, 2021

My DETA fan controllers are using device type fanlight and are working perfectly fine, can you confirm if this is still a valid issue?

There is also an update #267 coming very soon that will disable any existing values to be resent to the device such as a fan that's switched ON to be told to turn ON again -_-

@ElphaX ElphaX linked a pull request Apr 25, 2021 that will close this issue
@stibbzy
Copy link

stibbzy commented Apr 25, 2021

My DETA fan controllers are using device type fanlight and are working perfectly fine, can you confirm if this is still a valid issue?

There is also an update #267 coming very soon that will disable any existing values to be resent to the device such as a fan that's switched ON to be told to turn ON again -_-

Hi. I can’t confirm if other issue still exists. I got frustrated with the whole thing and ended up flashing the controllers with Tasmota and controlling them from Home Assistant.

@ElphaX ElphaX closed this as completed Apr 26, 2021
@AndrewJ1990
Copy link
Author

Hi @ElphaX , my Deta Fan controllers are still doing the same thing. Will only operate at full speed whenever turned on or trying to change speed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants