Modify default range of addSpeedParam()

eBeshi
Posts: 2
Joined: Mon Apr 15, 2024 9:55 am

Modify default range of addSpeedParam()

Postby eBeshi » Mon Apr 15, 2024 10:25 am

Dear all,

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);
However, this doesn't work with Google Home and just shows a range from 0% to 100%

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);
But apparently, you can only use 1 mode parameter per device for Google Home. The other custom mode parameter I made for the Heating/Cooling did not show up in Google Home but it does show up in the ESP Rainmaker app.

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

ESP_Piyush
Posts: 308
Joined: Wed Feb 20, 2019 7:02 am

Re: Modify default range of addSpeedParam()

Postby ESP_Piyush » Thu Apr 25, 2024 1:02 pm

Have you tried using ESP_RMAKER_PARAM_SPEED instead of ESP_RMAKER_PARAM_RANGE for the speed parameter?

eBeshi
Posts: 2
Joined: Mon Apr 15, 2024 9:55 am

Re: Modify default range of addSpeedParam()

Postby eBeshi » Sat May 11, 2024 12:02 pm

ESP_Piyush wrote:
Thu Apr 25, 2024 1:02 pm
Have you tried using ESP_RMAKER_PARAM_SPEED instead of ESP_RMAKER_PARAM_RANGE for the speed parameter?
Hi Piyush,
If I'm not mistaken, the functions you are mentioning are in C and not C++ correct? How would I go about that in C++?
I have used the range param before, but that does not appear in the Google home app since it's not parts of the AC device define in esprainmaker. So I used the speed param which does work however the default is 0 to 5.

Who is online

Users browsing this forum: No registered users and 13 guests