Since the new update of the Android OpenHAB app version 2.8.0 (August 1st, 2019) my slider items for shutter (“Rolladen”) are not working anymore. In previous versions, everything worked fine!!!
I copied your item and sitemap definitions (except the KNX stuff, since I don’t have any KNX devices) for RUGWohnenWest. I can drag the slider and it changes it’s value.
Can you describe your issue? Maybe someone with KNX can test this as well.
When I move the slider, nothing happens.
The events.log shows the following:
correct function using basic ui or Apple OpenHAB app:
2019-08-06 07:11:05.172 [ome.event.ItemCommandEvent] - Item ‘RUGWohnenWest’ received command 47
2019-08-06 07:11:10.922 [vent.ItemStateChangedEvent] - RUGWohnenWest changed from 0 to 47
================================================
not working using Android OpenHAB app:
==> /var/log/openhab2/openhab.log <==
2019-08-06 07:12:34.746 [WARN ] [.binding.knx.internal.bus.KNXBinding] - Value ‘50.0’ could not be sent to the KNX bus using datapoint ‘command DP 0/2/3 RUGWohnenWest, DPT main 0 id 5.001, low priority’ - retrying one time: 5.001 Scaling: wrong value format: 50.0
==> /var/log/openhab2/openhab.log <==
2019-08-06 07:12:34.752 [ERROR] [.binding.knx.internal.bus.KNXBinding] - Value ‘50.0’ could not be sent to the KNX bus using datapoint ‘command DP 0/2/3 RUGWohnenWest, DPT main 0 id 5.001, low priority’ - giving up after second try: 5.001 Scaling: wrong value format: 50.0
The KNX channel expects an integer (as a percent type, like a dimmer)
The UI slider here used to send integer, now it sends decimal.
As I understand slider behaviour in other UI’s, when start Item value is integer and step value is integer (which it will be for default step=1) an integer gets sent. But that’s more by luck than design, I’d say.
I think the weak link here is really the KNX binding - it should be doing its own conversion from decimal to integer if that’s what it needs?
This is a related KNX issue but going in the opposite direction, KNX DPT 5.001 to OH number/dimmer types
The issue is: openHAB uses a JSON API. From wikipedia:
JSON’s basic data types are:
Number: a signed decimal number that may contain a fractional part and may use exponential E notation, but cannot include non-numbers such as NaN. The format makes no distinction between integer and floating-point. JavaScript uses a double-precision floating-point format for all its numeric values, but other languages implementing JSON may encode numbers differently.
Before that app sent a “number”, now it sends a “number”. IMO the issue is, that the binding cannot cast from float to int. Let me see, if it’s possible to add a workaround to the app.
@mueller-ma Thanks a lot for your help! I downloaded openhab 2.7.0 release and everything works fine again, slider for rollershutter are working perfect again
Please inform me when you have a fix for the newest Android openHAB App.
Thanks again!!!
@mueller-ma IIRC, state updates are sent as strings, not numbers. The slider value is converted into a string by formatting the numeric value. Problem is in that value formatting, we previously distinguished between integer and float and used the respective toString methods, whereas we now always do Float.toString. We should apply the same logic asin toString also for formatValue, which should fix this issue.
So far as I can make out, OH2.4 Slider widgets only deal with integers until now. A step=2.5 doesn’t seem to allowed, for example.
However, there doesn’t seem to be any good reason for that?
There has been update to slider, I think in OH2.5 M1
I cannot test if this now allows decimal steps, limits, etc.
The broadly similar Setpoint widget works quite happily with decimal steps and decimal values, and will of course send decimal values to OH.
What I’m saying is that it seems perfectly legitimate to send decimal commands to a Dimmer or RollerShutter Item.
It’s a binding limitation if it can’t handle that.
Hey guys,
I’m facing the same issue.
Will this be fixed in the future? Having to downgrade to 2.7.0 is not really a fix.
I can only imagine a company who did 100 openhab installs and now has 100+ customers calling they can’t change their screens and dimmers anymore.
It’s been very very annoying for me, that’s for sure.
Thanks
Stijn
Just don’t use parseInt
Correct way is using .intValue on the state itself, since a Number isn’t (necessarily) an integer. See [SOLVED] Parse Number to Integer