joeyhage / homebridge-alexa-smarthome

Connect Alexa devices to HomeKit
MIT License
62 stars 20 forks source link

Very quick and dirty fan support #59

Closed domstarkey closed 6 months ago

domstarkey commented 8 months ago

I don't expect to merge this PR, but maybe someone gets some use from this until there's more complete fan support in this repo.

joeyhage commented 8 months ago

hi @domstarkey, thanks for creating a PR! I'm actually really close to providing fan support but have been blocked because I don't own an Alexa-connected fan and no one has provided the information I need yet to feel confident it will work. This is the information I need:

please upgrade the plugin to the latest version (2.0.1), enable debug in the plugin settings, and share the following output:

[date time] [HomebridgeAlexaSmartHome] <your device name here> ::: Current state: [
...
]
[date time] [HomebridgeAlexaSmartHome] <your device name here> ::: Range capabilities: [
...
]

Thanks!

domstarkey commented 8 months ago

@joeyhage - Great! Here's what I was able to generate. Current state looks good, but range capabilities are empty:

Fan ::: Range capabilities: {}

Fan ::: Current state: [
  {
    "namespace": "Alexa.ModeController",
    "name": "mode",
    "value": "nature",
    "instance": "Mode"
  },
  {
    "namespace": "Alexa.RangeController",
    "name": "rangeValue",
    "value": 1,
    "instance": "Fan.Speed"
  },
  {
    "namespace": "Alexa.EndpointHealth",
    "name": "connectivity",
    "value": {
      "value": "OK"
    }
  },
  {
    "namespace": "Alexa.PowerController",
    "name": "powerState",
    "value": "OFF"
  }
]
Fan ::: Attempting to add accessory(s) for device: {
  "id": "<<deviceID>>",
  "displayName": "Fan",
  "supportedProperties": [
    "turnOn@e<<deviceID>>_horizontal.swing",
    "turnOff",
    "setRangeValue@<<deviceID>>_Fan.Speed",
    "setModeValue@<<deviceID>>_Mode",
    "turnOn",
    "turnOff@<<deviceID>>_horizontal.swing"
  ],
  "supportedTriggers": [],
  "supportedOperations": [
    "turnOn@<<deviceID>>_horizontal.swing",
    "turnOff",
    "setRangeValue@<<deviceID>>_Fan.Speed",
    "setModeValue@<<deviceID>>_Mode",
    "turnOn",
    "turnOff@<<deviceID>>_horizontal.swing"
  ],
  "availability": "AVAILABLE",
  "icon": {
    "@iconType": "SmartHomeApplianceType",
    "value": "FAN"
  },
  "providerData": {
    "enabled": true,
    "relationships": [],
    "categoryType": "APPLIANCE",
    "deviceType": "FAN",
    "dmsDeviceIdentifiers": []
  }
}
joeyhage commented 6 months ago

@domstarkey thanks so much for creating this PR and fork. I will be adding basic support for fans as you have here in v2.0.8. From what I have discovered so far, various fan models and companies have very different underlying controls which has made it difficult to add full support for fans.