Humidity in percentage

Hi,
Slowly getting into it.

I read out a DHT11 (or DHT22) and I show the values (Temperature and humidity) via a Thing.
The problem is that I cannot display it as a humidity or percentage value. According to Schemes and properties there is a temperature property, but humidity or percentage isn’t. Just the brightness property, which of course doesn’t work…

Any idea how to add that property to the h-file? (which one and where?) or could this be implemented in a future update?

const char *dhtTypes[] = {"TemperatureHumiditySensor", nullptr};
const char *ledTypes[] = {"Light", nullptr};
ThingDevice DHT1("DHTsensor", "DHT temperature sensor plugged into a single pin", dhtTypes);
ThingDevice led1("led1", "Built-in LED 1", ledTypes);
ThingProperty TempProp("Temperature", "Digital Input Pin", NUMBER, "TemperatureProperty");
ThingProperty HumProp("Humidity", "Digital Input Pin", NUMBER, "TemperatureProperty");
ThingProperty ledOn1("on", "", BOOLEAN, "OnOffProperty");

Thank you

...
const char *dhtTypes[] = {"TemperatureSensor", "MultiLevelSensor", nullptr};
ThingDevice DHT1("DHTsensor", "DHT temperature sensor plugged into a single pin", dhtTypes);
ThingProperty TempProp("Temperature", "Digital Input Pin", NUMBER, "TemperatureProperty");
ThingProperty HumProp("Humidity", "Digital Input Pin", NUMBER, "LevelProperty");
...

void setup(void) {
  ...

  TempProp.unit = "degree celsius";
  DHT1.addProperty(&TempProp);

  HumProp.unit = "percent";
  DHT1.addProperty(&HumProp);

  ...
}


Not exactly where I wanted to go, but to monitor and log, that will do, thanks :smiley:

You can fix the labels by setting HumProp.title = "Humidity", for example.

Thank you, that helped a lot.

I could manage to get what I wanted with

  HumProp1.unit = "percent";
  HumProp1.title = "Humidity";
  HumProp1.readOnly = true;