joe-ng / homebridge-dyson-link

MIT License
206 stars 40 forks source link

Possibility to change the Temperature on Heat Mode? #6

Closed tijunoi closed 6 years ago

tijunoi commented 7 years ago

Hey, I have seen the plugin supports the Heat Mode on Pure Hot+Cool Link, but can it be made to ajust the temperature? (Like the Fan speed) I think it goes from 1ºC to 37ºC. It is only visible when Heat Mode is on in the Dyson Link app. I'm not sure if this can be done.

Anyway, thanks for this amazing plugin and your time!!

joe-ng commented 7 years ago

This is technically possible but I need to think about how it exposes in Home app because Apple API seemed not to provide just "heater" but both "heater & cooler" (that means there would be some state/button that makes no sense to be shown :p)

tijunoi commented 7 years ago

Okay, I'll rely on the Link app to change it. Anyway once I set up a temperature it gets saved and usually I want the same temperature always. :)

Also I've noticed that the Fam Speed is from 0 to 100% and then you do a Math.round to convert it to the Dyson 10 intensity levels. I'm guessing this is because Apple's API doesn't allow custom steps for fan service?:/

joe-ng commented 7 years ago

I'm guessing this is because Apple's API doesn't allow custom steps for fan service?:/

Yup, I think so

dpyy commented 6 years ago

I'm about to buy this device but I want to know what features I can get with homekit before buying it.

Is it true that, in fan mode I can control the fan speed. But in heat mode, I cannot control the temperature? Is this a limitation of homekit? Because I thought homekit has a device type called air conditioner, where you can set temperature?

joe-ng commented 6 years ago

Yup, that was HomeKit limitation. If we use air conditioner type, it will give you both cool and hot mode and cool mode may not make sense as we can’t set temperature in fan mode for Dyson

leoneleone commented 6 years ago

@joe-ng Maybe we could use Characteristic.HeatingCoolingState for Dyson Heat switch: // The value property of CurrentHeatingCoolingState must be one of the following: Characteristic.CurrentHeatingCoolingState.OFF = 0; that could be tied to Dyson fmod = OFF Characteristic.CurrentHeatingCoolingState.HEAT = 1; tied to Dyson hmod = HEAT (1) Characteristic.CurrentHeatingCoolingState.COOL = 2; *tied to Dyson hmod = OFF (2)

The HomeKit enumeration above should be mapped to each relevant individual Dyson mqtt topic/message accordingly.

Then map Dyson mqtt commad for Heat Temperature (not sure what that is in DysonLink’s mqtt api) to Characteristic.TargetTemperature, modified with Dyson’s heat temp setting limits.

These Characteristics can be added to the Service.Fanv2, so the mentioned Characteristics would be under the same primary Fanv2 service. I believe HeatingCoolingState will show up in the native Home app tile under Fanv2. I’m not sure if TargetTemperature will show in the Home app tile, but we can still definitely control this by Siri Voice Commands: “Set the Dyson Fan target temperature to 25° C” and so forth.

joe-ng commented 6 years ago

Thanks for your suggestion. From what I read in https://github.com/KhaosT/HAP-NodeJS/blob/master/lib/gen/HomeKitTypes.js#L2762

It seems that we can only have below characteristics for Fanv2 -

// Required Characteristics this.addCharacteristic(Characteristic.Active);

// Optional Characteristics this.addOptionalCharacteristic(Characteristic.CurrentFanState); this.addOptionalCharacteristic(Characteristic.TargetFanState); this.addOptionalCharacteristic(Characteristic.LockPhysicalControls); this.addOptionalCharacteristic(Characteristic.Name); this.addOptionalCharacteristic(Characteristic.RotationDirection); this.addOptionalCharacteristic(Characteristic.RotationSpeed); this.addOptionalCharacteristic(Characteristic.SwingMode);

leoneleone commented 6 years ago

@joe-ng

You can actually add any Characteristic to any Service and the Characteristic will still work. HomeKit is pretty agnostic when it comes to Characteristics. Just make sure to use addCharacteristic(.... instead of getCharacteristic and the suggested characteristics will work under the Fanv2 Service.

I’ve done this before with more than one plugin. On my version of the dyson plugin I’ve added the “Night Mode switch” as the Characteristic.NightVision (usually used for camera service), the Characteristic shows up and can be controlled in Eve app, it does not show in the Home app tile though.

Another example is that I’ve added Characteristic.Volume to a Switch Service before and everything works as intended...

While some Characteristics don’t show up for certain Service Types in the Home app, if the Characteristic can be controlled via Siri, you will still be able to use voice commands to change that Characteristic. 3rd party apps like Eve app will always show all added Characteristics, even if they are not the standard recommendations for that particular Service Type.

leoneleone commented 6 years ago

For the HeatingCooling Characteristic I would use: getCharacteristic(Characteristic.CurrentHeatingCoolingState) setCharacteristic(Characteristic.TargetHeatingCoolingState)

joe-ng commented 6 years ago

thanks! that's good to know. i don't have eve so i can only use what we have in home app.

leoneleone commented 6 years ago

You don’t need Eve products to use the Eve HomeKit app for control. Alternatively you can use another 3rd party HomeKit app to expose the characteristic control. I only use Eve to add characteristic changes (which don’t show in Home app) to my Automations and Scenes.

joe-ng commented 6 years ago

Just made a v1.7 to expose the heater function as a separate service/appliance. feel free to try that and see if that works for you

doughamm commented 6 years ago

Hey there! Heating controls seem to work but the bottom-end of the slider starts at 30 degrees Celsius. Perhaps this is a C-F issue but is it configurable somehow so I can start the scale at 0C?

joe-ng commented 6 years ago

I can change the slider limit to be something else but Dyson heater can only set be for certain range only(from 2xC/30C to 38C) so I just limit that to 30-38C for now

tijunoi commented 6 years ago

I can set the temperature on my Dyson from 1ºC to 37ºC 🤔

joe-ng commented 6 years ago

haha, I am not sure why I was under the impression of such limit. I didn't have a chance to test that out but have changed the limit to 1-38 in v1.7.1

doughamm commented 6 years ago

Excellent — thank you!!