I am building a device within a node that controls a 3-speed fan with 2 modes (Cooling/Heating). The device must be compatible with Google Voice Assistant(GVA) thus I must use the Standard Types. I am using the airconditioner device type for this reason.
To control the speed I used a standard parameter "addSpeedParam()" However the range from this function is 0 to 5.
How can I change this to 1 to 3?
I tried using a custom range parameter like this:
Code: Select all
Param speed("Speed", ESP_RMAKER_PARAM_RANGE, value(DEFAULT_SPEED), PROP_FLAG_READ | PROP_FLAG_WRITE);
speed.addUIType(ESP_RMAKER_UI_SLIDER);
speed.addBounds(value(1), value(3), value(1));
my_device->addParam(speed);
Then I tried using a custom mode parameter to select the speeds:
Code: Select all
static const char *modes[] = { "1", "2", "3" };
Param speed_param("Speed", ESP_RMAKER_PARAM_MODE, value("1"), PROP_FLAG_READ | PROP_FLAG_WRITE);
speed_param.addValidStrList(modes, 3);
speed_param.addUIType(ESP_RMAKER_UI_DROPDOWN);
my_device.addParam(speed_param);
I tried using the standard "AC Mode" parameter however, I couldn't find anything in the documentation to help me write the program.
I am using the Arduino IDE. Is there a better way to program for the Rainmaker service?
Where I got the standard types: https://rainmaker.espressif.com/docs/st ... types.html