Skip to content

Range index control is not valid #746

@denis-obukhov

Description

@denis-obukhov

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;
}


Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions