Skip to main content

Custom & standard types

Types are predefined schemas that describe the nature of a device and its parameters, and the UI element a client should render for them.

With custom types you define every aspect yourself — name, parameters, data types, UI hints, bounds — giving full flexibility to model any device. With standard types you use helper APIs for common devices such as light bulbs, fans, and temperature sensors: these set up the mandatory parameters, assign standard UI elements, and get you working phone-app rendering and voice-assistant integration with minimal code.

This page is the type reference. For the concepts behind nodes, devices, and parameters, see Data model.

Example usage

Creating a custom device

Creating a device generally takes several calls. A lightbulb with name, power, and brightness:

esp_rmaker_device_t *device = esp_rmaker_device_create("Light", NULL, NULL);

esp_rmaker_device_add_param(device,
esp_rmaker_param_create("Name", NULL, esp_rmaker_str("Light"),
PROP_FLAG_READ | PROP_FLAG_WRITE | PROP_FLAG_PERSIST));

esp_rmaker_param_t *power_param =
esp_rmaker_param_create("Power", NULL, esp_rmaker_bool(true),
PROP_FLAG_READ | PROP_FLAG_WRITE);
esp_rmaker_param_add_ui_type(power_param, ESP_RMAKER_UI_TOGGLE);
esp_rmaker_device_add_param(device, power_param);
esp_rmaker_device_assign_primary_param(device, power_param);

esp_rmaker_param_t *brightness_param =
esp_rmaker_param_create("Brightness", NULL, esp_rmaker_int(100),
PROP_FLAG_READ | PROP_FLAG_WRITE);
esp_rmaker_param_add_ui_type(brightness_param, ESP_RMAKER_UI_SLIDER);
esp_rmaker_param_add_bounds(brightness_param, esp_rmaker_int(0),
esp_rmaker_int(100), esp_rmaker_int(1));
esp_rmaker_device_add_param(device, brightness_param);

That flexibility lets you define any device. For common cases, standard types cut it down.

Creating a standard device

light_device = esp_rmaker_lightbulb_device_create("Light", NULL, true);
esp_rmaker_device_add_bulk_cb(light_device, bulk_write_cb, NULL);

esp_rmaker_device_add_param(light_device,
esp_rmaker_brightness_param_create(ESP_RMAKER_DEF_BRIGHTNESS_ID, 100));

The helper creates the device, adds the mandatory Name and Power parameters, and assigns Power as the primary parameter. Standard types also drive special handling in phone apps and third-party integrations such as Alexa and Google Voice Assistant.

Standard types

Below are the standard devices, services, parameters, and UI elements declared in esp_rmaker_standard_types.h. This list grows as new types are added.

Devices

caution

Parameters in bold are added automatically by the helper API. * indicates the primary parameter. Rows with no helper API are type strings only — build them with esp_rmaker_device_create() and the raw parameter APIs; they are listed because clients give them special handling.

NameTypeHelper APIParamsGVAAlexa
Switchesp.device.switchesp_rmaker_switch_device_createName, Power*SWITCHSWITCH
Lightbulbesp.device.lightbulbesp_rmaker_lightbulb_device_createName, Power*, Brightness, CCT, Hue, Saturation, Intensity, Light ModeLIGHTLIGHT
Lightesp.device.lightName, Power, Brightness, CCT, Hue, Saturation, Intensity, Light ModeLIGHTLIGHT
Fanesp.device.fanesp_rmaker_fan_device_createName, Power*, Speed, DirectionFANFAN
Temperature Sensoresp.device.temperature-sensoresp_rmaker_temp_sensor_device_createName, Temperature*THERMOSTATTEMPERATURE_SENSOR
Outletesp.device.outletName, PowerOUTLETSMARTPLUG
Plugesp.device.plugName, PowerOUTLETSMARTPLUG
Socketesp.device.socketName, PowerOUTLETSMARTPLUG
Lockesp.device.lockName, lock stateSMARTLOCK
Internal Blindsesp.device.blinds-internalName, Blinds PositionINTERIOR_BLIND
External Blindsesp.device.blinds-externalName, Blinds PositionEXTERIOR_BLIND
Garage Dooresp.device.garage-doorName, Garage PositionGARAGE_DOOR
Garage Door Lockesp.device.garage-door-lockName, lock stateSMARTLOCK
Speakeresp.device.speakerName, PowerSPEAKER
Air Conditioneresp.device.air-conditionerName, Power, Temperature, Speed, AC ModeAIR_CONDITIONER
Thermostatesp.device.thermostatName, Temperature, AC Mode, PowerTHERMOSTATTHERMOSTAT
TVesp.device.tvName, PowerTV
Washeresp.device.washerName, ModeWASHER
Zigbee Gatewayesp.device.zigbee_gatewayName, Add Zigbee Device
Thread Border Routeresp.device.thread-brName
Otheresp.device.otherOTHER

GVA and Alexa columns are the categories the RainMaker Neo backend maps each type to (action.devices.types.* and AVS display categories respectively). A in the GVA column means the type is not mapped and falls through to the SWITCH default.

The backend accepts more device types than the SDK declares

The cloud's voice-assistant converters also recognise esp.device.set-top, esp.device.remote, esp.device.contact-sensor, esp.device.motion-sensor, esp.device.doorbell, esp.device.security-panel, and esp.device.water-heater. There is no macro for these in esp_rmaker_standard_types.h — pass the string literal to esp_rmaker_device_create() if you need one.

Services

Services are created with esp_rmaker_service_create(). The SDK creates these three itself when you enable the corresponding feature; you do not build them by hand.

NameTypeService IDParamsEnabled by
Timeesp.service.timeTimeTZ, TZ-POSIXesp_rmaker_timezone_service_enable()
Systemesp.service.systemSystemReboot, Network-Reset, Factory-Reset — whichever flags you setesp_rmaker_system_service_enable()
Local Controlesp.service.local_controlLocal ControlType, POP, Usernameesp_rmaker_local_ctrl_service_enable()

Two further service types are declared but not implemented as data-model services in RainMaker Neo:

TypeStatus
esp.service.scheduleSchedules are real and always on, but they are exchanged through the details-maintenance mechanism (getSchedDetails), not as a service with a Schedules parameter. See Schedules and automations.
esp.service.otaOTA runs on AWS IoT Jobs, not on service parameters. There is no OTA service and no esp.param.ota_* parameters in use. See OTA firmware updates.

Parameters

Rows with a helper API are created fully configured — data type, UI type, properties, and bounds exactly as listed. Rows without one are type strings you apply yourself with esp_rmaker_param_create().

NameTypeHelper APIData TypeUI TypePropertiesMin, Max, Step
Nameesp.param.nameesp_rmaker_name_param_createStringRead, Write, PersistN/A
Poweresp.param.poweresp_rmaker_power_param_createBoolesp.ui.toggleRead, WriteN/A
Brightnessesp.param.brightnessesp_rmaker_brightness_param_createIntesp.ui.sliderRead, Write0, 100, 1
Hueesp.param.hueesp_rmaker_hue_param_createIntesp.ui.hue-sliderRead, Write0, 360, 1
Saturationesp.param.saturationesp_rmaker_saturation_param_createIntesp.ui.sliderRead, Write0, 100, 1
Intensityesp.param.intensityesp_rmaker_intensity_param_createIntesp.ui.sliderRead, Write0, 100, 1
CCTesp.param.cctesp_rmaker_cct_param_createIntesp.ui.sliderRead, Write2700, 6500, 100
Light Modeesp.param.light-modeesp_rmaker_light_mode_param_createIntesp.ui.dropdown or esp.ui.hiddenRead, Write1, 2, 1
1: HSV
2: CCT
Speedesp.param.speedesp_rmaker_speed_param_createIntesp.ui.sliderRead, Write0, 5, 1
Directionesp.param.directionesp_rmaker_direction_param_createIntesp.ui.dropdownRead, Write0, 1, 1
Temperatureesp.param.temperatureesp_rmaker_temperature_param_createFloatesp.ui.textRead, Time seriesN/A
Timezoneesp.param.tz— (Time service)StringRead, WriteN/A
Timezone POSIXesp.param.tz_posix— (Time service)StringRead, WriteN/A
Rebootesp.param.reboot— (System service)BoolRead, WriteN/A
Network-Resetesp.param.network-reset— (System service)BoolRead, WriteN/A
Factory-Resetesp.param.factory-reset— (System service)BoolRead, WriteN/A
Local Control POPesp.param.local_control_pop— (Local Control service)StringReadN/A
Local Control Typeesp.param.local_control_type— (Local Control service)IntReadN/A
Local Control Usernameesp.param.local_control_username— (Local Control service)StringReadN/A
Toggle Controlleresp.param.toggleBoolany applicableRead, WriteN/A
Range Controlleresp.param.rangeInt / Floatany applicableRead, Writeapp specific
Mode Controlleresp.param.modeStringesp.ui.dropdownRead, WriteN/A
AC Modeesp.param.ac-modeStringesp.ui.dropdownRead, WriteN/A
Blinds Positionesp.param.blinds-positionIntesp.ui.sliderRead, Write0, 100, 1
Garage Positionesp.param.garage-positionIntesp.ui.sliderRead, Write0, 100, 1
Add Zigbee Deviceesp.param.add_zigbee_deviceStringesp.ui.qr-scanRead, WriteN/A
OTA Statusesp.param.ota_statusStringReadDeclared, unused — see Services
OTA Infoesp.param.ota_infoStringReadDeclared, unused
OTA URLesp.param.ota_urlStringWriteDeclared, unused
Schedulesesp.param.schedulesArrayRead, Write, PersistDeclared, unused
Scenesesp.param.scenesArrayRead, Write, PersistDeclared, unused — scenes are not implemented

Default parameter IDs. The helpers use ESP_RMAKER_DEF_*_ID macros: "Name", "Power", "Brightness", "Hue", "Saturation", "Intensity", "CCT", "Light Mode", "Direction", "Speed", "Temperature". Reuse them so your parameter IDs match what other RainMaker devices report.

GVA traits. The backend maps parameter types to Google traits: Power → OnOff, Brightness → Brightness, Hue / Saturation / CCT → ColorSetting, Speed → FanSpeed, Temperature → TemperatureSetting, Light Mode / Mode → Modes. Name is metadata and maps to no trait.

UI elements

These tell the phone apps how to render a parameter.

NameTypeData TypesRequirements
Text (default)esp.ui.textAllN/A
Toggle Switchesp.ui.toggleBoolN/A
Slideresp.ui.sliderInt, FloatBounds (min, max)
Hue Slideresp.ui.hue-sliderIntParam type = esp.param.hue
Hue Circleesp.ui.hue-circleIntParam type = esp.param.hue
Push Button (big)esp.ui.push-btn-bigBoolN/A
Dropdownesp.ui.dropdownInt, StringBounds (min, max) for Int; valid strings for String
Triggeresp.ui.triggerBoolN/A
Hiddenesp.ui.hiddenAllParameter is not shown
QR Scanesp.ui.qr-scanStringN/A

A slider on esp.param.brightness, esp.param.cct, or esp.param.saturation is rendered as the corresponding specialised control by the apps — you still set esp.ui.slider; the param type drives the difference.

Type changes to watch for

If you are porting an existing application, or working from the ESP RainMaker type reference, these are the values to check:

PreviouslyESP RainMaker Neo
System reset parameteresp.param.wifi-reset ("Wi-Fi-Reset")esp.param.network-reset ("Network-Reset")
Hue UI typeesp.ui.slideresp.ui.hue-slider
Temperature propertiesReadRead + Time series, with esp.ui.text
Schedulesesp.service.schedules service with a Schedules parameterDetails-maintenance mechanism; type string declared but unused
OTAesp.service.ota with ota_url / ota_status / ota_infoAWS IoT Jobs; type strings declared but unused
ScenesSupportedNot implemented; type strings reserved
Device helpersswitch, lightbulb, fan, temp sensor, and moreswitch, lightbulb, fan, temp sensor only
Added typesesp.device.zigbee_gateway, esp.device.thread-br, esp.device.garage-door-lock, esp.param.add_zigbee_device, esp.ui.qr-scan
Dropped typesesp.device.dimmer, esp.param.humidity, esp.param.setpoint-temperature, esp.param.lockstate, esp.param.media-*, esp.param.volume, esp.param.mute, esp.param.app-selector, esp.param.input-selector, the alarm-state paramsNo macros declared — use string literals if you need them