GVA thermostat
Posted: Wed Jul 19, 2023 9:07 am
how can i get the google home to show thermostat controls? i saw another post with a very similar problem to mine (https://esp32.com/viewtopic.php?f=41&p=107275) but still couldnt figure it out..
ive attached a screenshot of what the google home shows. everything works as it should on the ESP rainmaker app.. heres the relevant code:
void Rainmaker::setup() {
// Configure the input GPIOs
pinMode(gpio_reset, INPUT);
//------------------------------------------- Declaring Node -----------------------------------------------------//
Node my_node;
my_node = RMaker.initNode("AC Node");
isUsingIntFanSpeed = true;
/* Create the device */
const esp_rmaker_device_t* acDevice = ac.getDeviceHandle();
/* Create the power switch parameter */
esp_rmaker_param_t* powerParam = esp_rmaker_param_create(POWER_PARAM_NAME, ESP_RMAKER_PARAM_POWER, value(false), PROP_FLAG_READ | PROP_FLAG_WRITE);
esp_rmaker_param_add_ui_type(powerParam, ESP_RMAKER_UI_TOGGLE);
esp_rmaker_device_add_param(acDevice, powerParam);
/* Create the setpoint temperature parameter */
esp_rmaker_param_t* setTempParam = esp_rmaker_param_create(SET_TEMP_PARAM_NAME, ESP_RMAKER_PARAM_RANGE, value(25), PROP_FLAG_READ | PROP_FLAG_WRITE);
esp_rmaker_param_add_ui_type(setTempParam, ESP_RMAKER_UI_SLIDER);
esp_rmaker_param_add_bounds(setTempParam, value(16), value(30), value(1));
esp_rmaker_device_add_param(acDevice, setTempParam);
esp_rmaker_param_t* tempValParam = esp_rmaker_param_create(TEMP_VAL_PARAM_NAME, ESP_RMAKER_PARAM_TEMPERATURE, value(25), PROP_FLAG_READ);
esp_rmaker_device_add_param(acDevice, tempValParam);
/* Create the fan speed parameter */
esp_rmaker_param_t* fanSpeedParam = esp_rmaker_param_create(FAN_PARAM_NAME, "esp.param.speed", value(0), PROP_FLAG_READ | PROP_FLAG_WRITE);
esp_rmaker_param_add_ui_type(fanSpeedParam, ESP_RMAKER_UI_SLIDER);
esp_rmaker_param_add_bounds(fanSpeedParam, value(0), value(5), value(1));
esp_rmaker_device_add_param(acDevice, fanSpeedParam);
/* Create the AC mode parameter */
esp_rmaker_param_t* acModeParam = esp_rmaker_param_create(MODE_PARAM_NAME, ESP_RMAKER_PARAM_AC_MODE, value(mode_values[0]), PROP_FLAG_READ | PROP_FLAG_WRITE);
esp_rmaker_param_add_ui_type(acModeParam, ESP_RMAKER_UI_DROPDOWN);
esp_rmaker_param_add_valid_str_list(acModeParam, mode_values, sizeof(mode_values) / sizeof(mode_values[0]));
//esp_rmaker_param_add_bounds(acModeParam, esp_rmaker_int(0), esp_rmaker_int(5), esp_rmaker_int(1));
esp_rmaker_device_add_param(acDevice, acModeParam);
/* Add the device to the Rainmaker Node */
ac.addCb(write_callback);
ac.assignPrimaryParam(setTempParam);
//ac.assignPrimaryParam(powerParam);
my_node.addDevice(ac);
// This is optional
RMaker.enableOTA(OTA_USING_PARAMS);
RMaker.enableTZService();
RMaker.enableSchedule();
Serial.printf("\nStarting ESP-RainMaker\n");
RMaker.start();
WiFi.onEvent(sysProvEvent);
#if CONFIG_IDF_TARGET_ESP32
WiFiProv.beginProvision(WIFI_PROV_SCHEME_BLE, WIFI_PROV_SCHEME_HANDLER_FREE_BTDM, WIFI_PROV_SECURITY_1, pop, service_name);
#else
WiFiProv.beginProvision(WIFI_PROV_SCHEME_SOFTAP, WIFI_PROV_SCHEME_HANDLER_NONE, WIFI_PROV_SECURITY_1, pop, service_name);
#endif
xSemaphoreGive(callbackSemaphore);
}
ive attached a screenshot of what the google home shows. everything works as it should on the ESP rainmaker app.. heres the relevant code:
void Rainmaker::setup() {
// Configure the input GPIOs
pinMode(gpio_reset, INPUT);
//------------------------------------------- Declaring Node -----------------------------------------------------//
Node my_node;
my_node = RMaker.initNode("AC Node");
isUsingIntFanSpeed = true;
/* Create the device */
const esp_rmaker_device_t* acDevice = ac.getDeviceHandle();
/* Create the power switch parameter */
esp_rmaker_param_t* powerParam = esp_rmaker_param_create(POWER_PARAM_NAME, ESP_RMAKER_PARAM_POWER, value(false), PROP_FLAG_READ | PROP_FLAG_WRITE);
esp_rmaker_param_add_ui_type(powerParam, ESP_RMAKER_UI_TOGGLE);
esp_rmaker_device_add_param(acDevice, powerParam);
/* Create the setpoint temperature parameter */
esp_rmaker_param_t* setTempParam = esp_rmaker_param_create(SET_TEMP_PARAM_NAME, ESP_RMAKER_PARAM_RANGE, value(25), PROP_FLAG_READ | PROP_FLAG_WRITE);
esp_rmaker_param_add_ui_type(setTempParam, ESP_RMAKER_UI_SLIDER);
esp_rmaker_param_add_bounds(setTempParam, value(16), value(30), value(1));
esp_rmaker_device_add_param(acDevice, setTempParam);
esp_rmaker_param_t* tempValParam = esp_rmaker_param_create(TEMP_VAL_PARAM_NAME, ESP_RMAKER_PARAM_TEMPERATURE, value(25), PROP_FLAG_READ);
esp_rmaker_device_add_param(acDevice, tempValParam);
/* Create the fan speed parameter */
esp_rmaker_param_t* fanSpeedParam = esp_rmaker_param_create(FAN_PARAM_NAME, "esp.param.speed", value(0), PROP_FLAG_READ | PROP_FLAG_WRITE);
esp_rmaker_param_add_ui_type(fanSpeedParam, ESP_RMAKER_UI_SLIDER);
esp_rmaker_param_add_bounds(fanSpeedParam, value(0), value(5), value(1));
esp_rmaker_device_add_param(acDevice, fanSpeedParam);
/* Create the AC mode parameter */
esp_rmaker_param_t* acModeParam = esp_rmaker_param_create(MODE_PARAM_NAME, ESP_RMAKER_PARAM_AC_MODE, value(mode_values[0]), PROP_FLAG_READ | PROP_FLAG_WRITE);
esp_rmaker_param_add_ui_type(acModeParam, ESP_RMAKER_UI_DROPDOWN);
esp_rmaker_param_add_valid_str_list(acModeParam, mode_values, sizeof(mode_values) / sizeof(mode_values[0]));
//esp_rmaker_param_add_bounds(acModeParam, esp_rmaker_int(0), esp_rmaker_int(5), esp_rmaker_int(1));
esp_rmaker_device_add_param(acDevice, acModeParam);
/* Add the device to the Rainmaker Node */
ac.addCb(write_callback);
ac.assignPrimaryParam(setTempParam);
//ac.assignPrimaryParam(powerParam);
my_node.addDevice(ac);
// This is optional
RMaker.enableOTA(OTA_USING_PARAMS);
RMaker.enableTZService();
RMaker.enableSchedule();
Serial.printf("\nStarting ESP-RainMaker\n");
RMaker.start();
WiFi.onEvent(sysProvEvent);
#if CONFIG_IDF_TARGET_ESP32
WiFiProv.beginProvision(WIFI_PROV_SCHEME_BLE, WIFI_PROV_SCHEME_HANDLER_FREE_BTDM, WIFI_PROV_SECURITY_1, pop, service_name);
#else
WiFiProv.beginProvision(WIFI_PROV_SCHEME_SOFTAP, WIFI_PROV_SCHEME_HANDLER_NONE, WIFI_PROV_SECURITY_1, pop, service_name);
#endif
xSemaphoreGive(callbackSemaphore);
}