So new problems with battery level and UoM. I have devices from AVM (DECT 301), Shelly (H&T), Netatmo Modules (Indoor and Outdoor) and Philips Hue (Motion Indoor and Outdoor) which all have a battery level channel. All of them should, when you look into the openHAB binding documentation (4.0.1), use an item type of Number and the UoM should be percent.
In my openHAB 4.0.1 only Netatmo delivers without any editing a percent value, which is shown with “%” in the UI.
Number eg_schlafzimmer_netatmo_innenmodul_messwert_batterie "Batteriestand" <battery> (gBatterie_Netatmo_Schlafzimmer) ["Measurement", "Energy"] {channel="netatmo:indoor:abcdefgh:basisstation:schlafzimmer:battery#value"}
For AVM and Philips Hue, I had to add a “,unit=”%" to the relevant channels, then the UI shows also “%”. Without, I got only a Number value like “73”.
Number eg_badezimmer_dect301_messwert_batterie "Batteriestand" <battery> (gBatterie_Thermostat_Badezimmer) ["Measurement", "Energy"] {channel="avmfritz:FRITZ_DECT_301:192_168_3_2:avm_fb_thermostat_badezimmer:battery_level", unit="%"}
Number eg_badezimmer_hue_messwert_batterie "Batteriestand" <battery> (gBatterie_Bewegungsmelder_Badezimmer) ["Measurement", "Energy"] {channel="hue:device:************:bewegungsmelder_02:battery-level", unit="%"}
Only Shelly H&T will not work like expected. I also added the “,unit=”%" to the channel and got then a value like “100.0” without “%”. Then I changed the item to
Number eg_badezimmer_sensor_messwert_batterie "Batteriestand [%.0f %unit%]" <battery> (gBatterie_Shelly_HT_Badezimmer) ["Measurement", "Energy"] {channel="shelly:shellyht:******:battery#batteryLevel", unit="%"}
And now it shows again only a battery level of “100” without any percent.
So my first question is, if anybody knows if the bindings for AVM, Hue and Shelly don’t have finally implemented the UoM completely?
And why is the behavior of the Shelly H&T so…?