0

I am developing fanSpeed and colorSetting trait for Google Actions, but whenever I execute command for setting fan speed or setting light colour, it fails. Here is my JSON for sync,query and execute step:

sync

{
"requestId":"d25ty67q-98jui-581aa-j891-b1f6dhuas"
"payload":{
  "devices": [
    {
      "id": "AA96A0#16",
      "type": "action.devices.types.FAN",
      "traits": [
        "action.devices.traits.OnOff",
        "action.devices.traits.FanSpeed"
      ],
      "roomHint": "ROOM",
      "deviceInfo": {
        "manufacturer": "smart Homes"
      },
      "name": {
        "defaultNames": [
          "fan"
        ],
        "name": "fan"
      },
      "willReportState": true,
      "customData": {
        
      },
      "attributes": {
        "commandOnlyOnOff": false,
        "commandOnlyFanSpeed": false,
        "reversible": false,
        "availableFanSpeeds": {
          "speeds": [
              {"speed_name": "speed_low", "speed_values": [{"speed_synonym": ["low", "low speed", "slow"], "lang": "en"}]},
              {"speed_name": "speed_medium", "speed_values": [{"speed_synonym": ["medium", "medium speed", "med"], "lang": "en"}]},
              {"speed_name": "speed_high", "speed_values": [{"speed_synonym": [ "high speed", "high"], "lang": "en"}]},
              {"speed_name": "speed_highest", "speed_values": [{"speed_synonym": [ "highest speed", "highest"], "lang": "en"}]}
          ],
          "ordered": true
        }
      }
    },   
    {
      "id": "240A50#0",
      "type": "action.devices.types.LIGHT",
      "traits": [
        "action.devices.traits.OnOff",
        "action.devices.traits.ColorSetting"
      ],
      "roomHint": "ROOM",
      "deviceInfo": {
        "manufacturer": "smart Homes"
      },
      "name": {
        "defaultNames": [
          "light"
        ],
        "name": "light"
      },
      "willReportState": false,
      "customData": {
       
      },
      "attributes": {
        "commandOnlyColorSetting": true,
        "colorModel": "hsv"
      }
    }
  ],
  "agentUserId": "Home555"
}
}

Execute Fan:

{
  "commands": [
    {
      "ids": [
        "AA96A0#16"
      ],
      "status": "SUCCESS",
      "states": {
        "online": true,
        "on": true,
        "currentFanSpeedSetting": "speed_highest"
      }
    }
  ]
}

Query Fan:

{
"requestId":"167278043664013971",
"payload":{
  "devices": {
    "AA96A0#16": {
      "status": "SUCCESS",
      "online": true,
      "on": true,
      "currentFanSpeedSetting": "speed_highest"
    }
  }
}
}

Execute color-light:

{
  "commands": [
    {
      "ids": [
        "240A50#0"
      ],
      "status": "SUCCESS",
      "states": {
        "online": true,
        "on": true,
        "color": {
          "spectrumHSV": {
            "hue": 120,
            "saturation": 1,
            "value": 1
          }
        }
      }
    }
  ]
}

Query color-light:

{
"requestId":"167278043664013971",
"payload":{
  "devices": {
    "240A50#0": {
      "status": "SUCCESS",
      "online": true,
      "on": true,
      "color": {
        "spectrumHSV": {
          "hue": 0,
          "saturation": 0,
          "value": 1
        }
      }
    }
  }
}
}

Speaker response: Sorry, it looks like smart homes is unavailable right now.

However my request is always executing and I can see state change on my device. Can anyone point out Why it is failing?

1 Answers1

0

The json for execute for both the fan and the bulb has missing values for requestId. This might be causing the failures with the execution commands.