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

convertibleRoofState(Object)
data.value

(String) (enum)

timestamp

(Date)

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)

sunroofRainEvent(Object)
data.value

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

timestamp

(Date)

sunroofState(Object)
data.value

(String) (enum)

timestamp

(Date)

sunroofTiltState(Object)
data.value

(String) (enum)

timestamp

(Date)

tiltPosition(Object)
data.value

(Number) (double) 1.0 (100%) is fully tilted, 0.0 (0%) is not

timestamp

(Date)

Example

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

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({ convertibleRoofState, dimming, position, sunroofState, sunroofTiltState })

Parameters

convertibleRoofState

(String) (enum)

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

sunroofState

(String) (enum)

sunroofTiltState

(String) (enum)

Example

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