It seems that Android app has a bug with sitemap’s setpoint element.
I have two of them on my sitemap, one with fractional “step” value. This element with fractional value is incorrectly displayed on the edit dialog on Android: the edit dialog displays zero instead of actual value. Also it’s not possible to select any other values, data just disappears. The neighbor element with non-fractional value behaves fine.
Web version of sitemap works as should.
Number DryerT1Start “[MAP(hours_timer_30.map):%s]” (StartPersist,DryerT1)
Number DryerT1Duration “[%d min]” (StartPersist,DryerT1)
And maybe the hours_timer_30.map will be useful too. The idea of this trick is to have only one UI control to select hours and minutes of the day. A little ugly, but unfortunately OpenHAB sitemap elements doesn’t have more useful control. Or at least, I don’t see it.
Tried, the suggested formatter change causes an error:
2019-03-25 21:49:09.863 [WARN ] [ui.internal.items.ItemUIRegistryImpl] - Exception while formatting value ‘40’ of item DryerT1Duration with format ‘%0.2d min’: %0.2d
And the issue is not related to DryerT1Duration item. The trouble is with DryerT1Start and the value picker dialog. It should display the set of values from 0.0 to 23.5 but only shows zero as a single choice. And, when attempt to scroll the value in this dialog up or down, even this orphan zero completely disappears.
Guessing - the MAP was added for cosmetic reasons. It worked before that? (albeit with messy number representation)
It’s a neat idea, but I think the whole principle may be flawed. You want to display a string “20:30” that is not readily converted to a number for use in a setpoint widget, it cannot “know” that is supposed to be 20.5 numeric.
It all rather depends if the setpoint widget fetches textual representation separately from umm, widget-action representation.
How well does the widget in Basic UI work with all this?
I don’t think there’s much we can do here, except the picker should start at 6.5 (in that case) instead of 0. After all, the app only has the REST API response above to figure out the items to be displayed … it has no chance of knowing the mapping for formatting.
Additionally, we need to parse the duration as integer (‘100’), not float (‘100.0’) … we currently do the latter, which breaks the formatting pattern. I’ll submit a PR for those items.
If you have any better idea how to make just one UI control to pick the value of hours and minutes - please share your ideas. Create two pickers, one for hours and other for minutes, ates too many screen space (especially on mobile devices) and in general looks ugly.