3

I had implemented Fan turn on/off feature with OnOff trait and fan modes('High', 'Medium', 'Low') with Fanspeed trait, now i want to implement percentage controller. Ex: set the fan speed to 50 percent. How can i implement this?

Sai Prasad Goud
  • 199
  • 1
  • 7
  • At the moment the FanSpeed [only supports discrete fan speed names](https://developers.google.com/assistant/smarthome/traits/fanspeed) in the public documentation, but stay tuned to this [issue](https://issuetracker.google.com/147609501) as documentation on how to use the feature is coming up soon. – Nick Felker Feb 27 '20 at 16:31
  • @NickFelker Thanks for your support, i will wait for this feature to be out. – Sai Prasad Goud Feb 28 '20 at 06:19

1 Answers1

1

Take reference supportsFanSpeedPercent Boolean. If set to true, this device will accept commands for adjusting the speed using a percentage from 0.0 to 100.0. Defaults to false.

It seems that you have set the value for this as False or not mentioned this attribute in your capability.

Look at this sample code:

{
  "availableFanSpeeds": {
    "speeds": [{
      "speed_name": "S1",
      "speed_values": [{
        "speed_synonym": ["low", "speed 1", ... ],
        "lang": "en" } , … ]
      },
      {
      "speed_name": "S2",
      "speed_values": [{
        "speed_synonym": ["high", "speed 2", ... ],
         "lang": "en" } , … ]
      }, ...
      ],
    "ordered": true
    },
  "supportsFanSpeedPercent": true,
  "reversible": true
}

Source: https://developers.google.com/assistant/smarthome/traits/fanspeed#response-nodejs

gyanendra
  • 26
  • 1