Hi, I cannot figure out, why, on one given device properties are not created.
in setup(), I have following code that should create three properties:
thing["toggleDevice2.2"] = []() {
mqtt.publish("cmnd/thinger2/Power2", "TOGGLE");
};
thing["toggleDevice1.1"] = []() {
mqtt.publish("cmnd/thinger1/Power1", "TOGGLE");
};
pson whoami; //Setting IP and Version reminder property on thinger
whoami["IP"] = WiFi.localIP().toString();
whoami["MAC"] = WiFi.macAddress();
whoami["HOST"] = WiFi.hostname();
whoami["Soft"] = __FILE__;
whoami["Date"] = __DATE__;
whoami["Time"] = __TIME__;
whoami["WURL"] = openWeatherMapsURL;
thing.set_property("whoami", whoami, true);
At least the code with the “thing.set_property” was used successfully on other projects.
My device still has no property at all.
Else, it works fine.
Has someone an idea, what prevents creating properties?
Thank you…
The complete code is here:
It looks like the thinger.io backend has stopped creating properties automatically.
A previous software that used to work does not create properties any more.
The devices with already created properties work, but new ones are not created.
Opened issue in GitHub: Properties are not created any more. · Issue #112 · thinger-io/thinger-server · GitHub
Finally I found the cause:
You need a
thing.handle();
delay(1000); // Wait for contact to happen.
in setup()
before declaring the pson whoami.