Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Range index control is not valid #746

Open
denis-obukhov opened this issue Jul 24, 2023 · 0 comments
Open

Range index control is not valid #746

denis-obukhov opened this issue Jul 24, 2023 · 0 comments

Comments

@denis-obukhov
Copy link

denis-obukhov commented Jul 24, 2023

Develop branch.

Simple settable property is defined. When I write "true" or "false" or any other value to the appropriate topic (homie/esp_node/fan_control/stage1_on/set) (either manually via MQTT Explorer or using a ready-to-use Homie convention module in NodeRED) I get "Range index control is not valid" message in console. fanStage1Handler is never called. I can't figure out where it comes from. Can't find anything similar to this.

#include <Homie.h>

const int FAN_MODE_PIN_1 = D6;
HomieNode fanNode("fan_control", "Fan Control", "switch");
bool fanStage1Handler(const HomieRange& range, const String& value);

void loopHandler() {
}

void setup() {
  Serial.begin(115200);
  Serial << endl << endl;
  delay(1000);

  pinMode(FAN_MODE_PIN_1, OUTPUT);

  Homie_setFirmware("esp_node", "1.0.0");
  Homie.setLoopFunction(loopHandler);


  fanNode.advertise("stage1_on").setName("Fan stage 1").setDatatype("boolean").settable(fanStage1Handler);
  Homie.setup();
}

void loop() {
  Homie.loop();
}

bool fanStage1Handler(const HomieRange& range, const String& value) { 
  Homie.getLogger() << "fanStage1Handler is fired " << endl;
  return true;
}


Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant