Hi,
while working with my config files I got this strange behaviour - someone here perhaps could explain me what’s going wrong?
I’ve got a Homematic HM-LC-Dim1T-FM dim actor, and I defined two items via items config file; the both are labeled as “Bad Wandlicht”, and that’s what they should show up in sitemap.
Dimmer Badezimmer_1_Wandlicht
"Bad Wandlicht"
<light>
(gSK_HS_2, gBad, gLampen)
{ channel="homematic:HM-LC-Dim1T-FM:ccu2:MEQxxxxxxx:1#LEVEL" }
Switch Badezimmer_1_Wandlicht_Toggle
"Bad Wandlicht"
<light>
(gBad)
{ channel="homematic:HM-LC-Dim1T-FM:ccu2:MEQxxxxxxx:1#LEVEL" }
Relevant part of my sitemap file goes here:
// Badezimmer Wandleuchten
Slider item=Badezimmer_1_Wandlicht
visibility=[Badezimmer_1_Wandlicht_Toggle=="ON"]
Switch item=Badezimmer_1_Wandlicht_Toggle
visibility=[Badezimmer_1_Wandlicht=="0"]
mappings=[ON="Ein"]
What happens when using this sitemap is this:
2017-11-05 19:01:08.762 [vent.ItemStateChangedEvent] - Badezimmer_1_Wandlicht_Toggle changed from ON to OFF
==> /var/log/openhab2/openhab.log <==
2017-11-05 19:01:08.761 [WARN ] [ui.internal.items.ItemUIRegistryImpl] - Exception while formatting value 'OFF' of item Badezimmer_1_Wandlicht_Toggle with format '%.2f %%': {}
java.util.IllegalFormatConversionException: f != java.lang.String
at java.util.Formatter$FormatSpecifier.failConversion(Formatter.java:4302) [?:?]
at java.util.Formatter$FormatSpecifier.printFloat(Formatter.java:2806) [?:?]
at java.util.Formatter$FormatSpecifier.print(Formatter.java:2753) [?:?]
at java.util.Formatter.format(Formatter.java:2520) [?:?]
at java.util.Formatter.format(Formatter.java:2455) [?:?]
at java.lang.String.format(String.java:2940) [?:?]
at org.eclipse.smarthome.core.library.types.OnOffType.format(OnOffType.java:24) [98:org.eclipse.smarthome.core:0.9.0.201710240931]
at org.eclipse.smarthome.ui.internal.items.ItemUIRegistryImpl.getLabel(ItemUIRegistryImpl.java:365) [137:org.eclipse.smarthome.ui:0.9.0.201710240931]
at org.eclipse.smarthome.io.rest.sitemap.internal.PageChangeListener.constructSitemapEvents(PageChangeListener.java:191) [118:org.eclipse.smarthome.io.rest.sitemap:0.9.0.201710240931]
at org.eclipse.smarthome.io.rest.sitemap.internal.PageChangeListener.constructSitemapEvents(PageChangeListener.java:184) [118:org.eclipse.smarthome.io.rest.sitemap:0.9.0.201710240931]
at org.eclipse.smarthome.io.rest.sitemap.internal.PageChangeListener.stateChanged(PageChangeListener.java:156) [118:org.eclipse.smarthome.io.rest.sitemap:0.9.0.201710240931]
at org.eclipse.smarthome.core.items.GenericItem$1.run(GenericItem.java:229) [98:org.eclipse.smarthome.core:0.9.0.201710240931]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [?:?]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [?:?]
at java.lang.Thread.run(Thread.java:745) [?:?]
And that’s the part I can’t understand: I never told to use this “%.2f %%” format - where does it take this information from? The only possibility to avoid this error message is to explicitly set the label to something like “Bad Wandlicht [%s]” - but I think it has to work without too, hasn’t it? I have lots of other items and no problems so far… I already deleted the items and re-created them with another item name, restarted openHAB etc, but when it comes up, it recognizes this item again and throws the error…
- openhab-2.2.0~20171104020304-1 on Rasbian Jessie, RP 3
- oracle-java8-jdk 8u65
Cheers,
Marianne