Skip to main content

ESPCDFServiceParam

ESPCDFServiceParam is one parameter on an ESPCDFService. Use it the same way as device params when your UI binds to service-level state (feature flags, service metadata, etc.).


Properties

PropertyTypeDescription
namestringParam name
valueanyCurrent value
typestringParam type
serviceNameoptionalParent service name
operationsESPCDFServiceParamOperationSDK delegates
_rawanyOriginal SDK param
eventsESPCDFOperationEventEmitterOperation bus

Common Workflows

Read and write a service param

import { initCDF } from "@espressif/rainmaker-base-cdf";

const espCDF = await initCDF({ sdkAdaptorRegistry });
const node = espCDF.nodeStore.getNodeById("node-id")!;
const service = node.services?.find((s) => s.name === "esp.service.time");
const param = service?.params.find((p) => p.name === "esp.param.tz");

await param?.setValue("Asia/Kolkata");

Error Handling

try {
await param!.setValue(newValue);
} catch (e) {
showErrorBanner("Service param update failed");
}


On this page