Rooftop Control

getRooftopState([, propertyNames])

Declaration

hmkit.commands.RooftopControl.getRooftopState()

Parameters

propertyNames

(optional) Array of names of the properties you want returned.

Returns

RooftopControlResponse

Example

hmkit.telematics.sendCommand(
  hmkit.commands.RooftopControl.getRooftopState(),
  accessCertificate
);

RooftopControlResponse

Parameters

dimming(Object)
data.value

(Number) (double) 1.0 (100%) is opaque, 0.0 (0%) is transparent

timestamp

(Date)

position(Object)
data.value

(Number) (double) 1.0 (100%) is fully open, 0.0 (0%) is closed

timestamp

(Date)

convertibleRoofState(Object)
data.value

(String) (enum)

timestamp

(Date)

sunroofTiltState(Object)
data.value

(String) (enum)

timestamp

(Date)

sunroofState(Object)
data.value

(String) (enum)

timestamp

(Date)

sunroofRainEvent(Object)
data.value

(String) (enum) Sunroof event happened in case of rain

timestamp

(Date)

Example

{
  "dimming": {
    "timestamp": "2021-06-01T15:48:04.887Z",
    "data": {
      "value": 1
    }
  },
  "position": {
    "timestamp": "2021-06-01T15:48:04.887Z",
    "data": {
      "value": 0.5
    }
  },
  "convertibleRoofState": {
    "timestamp": "2021-06-01T15:48:04.887Z",
    "data": {
      "value": "open"
    }
  },
  "sunroofTiltState": {
    "timestamp": "2021-06-01T15:48:04.887Z",
    "data": {
      "value": "half_tilted"
    }
  },
  "sunroofState": {
    "timestamp": "2021-06-01T15:48:04.887Z",
    "data": {
      "value": "open"
    }
  },
  "sunroofRainEvent": {
    "timestamp": "2021-06-01T15:48:04.887Z",
    "data": {
      "value": "no_event"
    }
  }
}

getAvailability([, propertyNames])

Declaration

hmkit.commands.RooftopControl.getAvailability()

Parameters

propertyNames

(optional) Array of names of the properties you want returned.

Example

// Get availability for all properties
hmkit.telematics.sendCommand(
  hmkit.commands.RooftopControl.getAvailability(),
  accessCertificate
);
// Get availability for specific properties
hmkit.telematics.sendCommand(
  hmkit.commands.RooftopControl.getAvailability(['dimming']),
  accessCertificate
);

Response

Parameters

availability(Object)
updateRate.value

(String) enum

rateLimit.value

(Number)

rateLimit.unit

(String)

appliesPer.value

(String)

Discussion

The response contains an availability object for each property, as shown in the example

Example

{
  "dimming": {
    "availability": {
      "updateRate": {
        "value": "trip_high"
      },
      "rateLimit": {
        "value": 64,
        "unit": "hertz"
      },
      "appliesPer": {
        "value": "vehicle"
      }
    }
  }
}

controlRooftop({ dimming, position, convertibleRoofState, sunroofTiltState, sunroofState })

Parameters

dimming

(Number) (double) 1.0 (100%) is opaque, 0.0 (0%) is transparent

position

(Number) (double) 1.0 (100%) is fully open, 0.0 (0%) is closed

convertibleRoofState

(String) (enum)

sunroofTiltState

(String) (enum)

sunroofState

(String) (enum)

Example

hmkit.telematics.sendCommand(
  hmkit.commands.RooftopControl.controlRooftop({
    "dimming": 1,
    "position": 0.5,
    "convertibleRoofState": "open",
    "sunroofTiltState": "half_tilted",
    "sunroofState": "open"
  }),
  accessCertificate
);