The use of the ESP8266 in the world of IoT

User avatar
By mkf
#55396 I'm trying under arduino ide, my configuration is ok with older iotmanager version but in 1.5.0 only toggle and range still working, not display-value; no errors in log...

thanks for any suggestions!


void initVar() {
JsonObject& root = jsonBuffer.createObject();
sTopic[0] = prefix + "/" + deviceID + "/ctrl0";
root["id"] = 0;
root["page"] = "lamp";
root["widget"] = "toggle";
root["color"] = "green";
root["descr"] = "lamp";
root["topic"] = sTopic[0];

root.printTo(thing_config[0]);


JsonObject& root1 = jsonBuffer.createObject();
sTopic[1] = prefix + "/" + deviceID + "/ctrl1";

root1["id"] = 2;
root1["page"] = "lamp";
root1["widget"] = "range";
root1["descr"] = "3h timer";
root1["style"] = "range-assertive";
root1["topic"] = sTopic[1];
root1["badge"] = "badge-assertive";

root1.printTo(thing_config[1]);


JsonObject& root2 = jsonBuffer.createObject();
sTopic[2] = prefix + "/" + deviceID + "/ctrl2";

root2["id"] = 1;
root2["page"] = "lamp";
root2["widget"] = "display-value";
root2["class1"] = "item no-border";
root2["style1"] = "";
root2["class2"] = "balanced";
root2["style2"] = "font-size:20px;float:left;padding-top:10px;font-weight:bold;";
root2["topic"] = sTopic[2];
root2["class3"] = "";
root2["style3"] = "float:right;";
root2["height"] = "40";
root2["color"] = "#52FF00";
root2["inactive_color"] = "#414141";
root2["digits_count"] = 3;

root2.printTo(thing_config[2]);
}
Last edited by mkf on Tue Sep 20, 2016 10:56 am, edited 1 time in total.