Hello,
I’m new to OpenHAB and KNX, so perhaps there is an easy solution to my problem.
I have an old KNX shutter actuator, which is only capable of sending out the position in the form of three integer values (encoded in 1 byte just like DPT 5.001):
0 - moving/stopped in between
1 - Fully open
2 - Fully closed
Sadly, there is no update for it according to the manufacturer, so unless I’d were to replace all those actuators I have no chance of getting a percent value (0-100%) as the position information.
For the last two days I’ve looked into a solution for at least displaying the available data.
What does not work:
Keeping the default DPT 5.001 for the position parameter in my KNX .things file, as it maps
0 to 0%
1 to 0%
2 to 1%
This is due to the percentage interpretation of the raw data. Then I’d be down to two states.
DPT 5.005 does not work either, as it causes an error for the value 2, the rest would be fine:
java.lang.IllegalArgumentException: Value must be between 0 and 100
at org.eclipse.smarthome.core.library.types.PercentType.validateValue(PercentType.java:58) ~[?:?]
at org.eclipse.smarthome.core.library.types.PercentType.<init>(PercentType.java:53) ~[?:?]
at org.eclipse.smarthome.core.library.types.DecimalType.as(DecimalType.java:160) ~[?:?]
at org.eclipse.smarthome.core.internal.items.ItemStateConverterImpl.convertToAcceptedState(ItemStateConverterImpl.java:58) ~[?:?]
at org.eclipse.smarthome.core.thing.internal.profiles.ProfileCallbackImpl.sendUpdate(ProfileCallbackImpl.java:135) ~[?:?]
at org.eclipse.smarthome.core.thing.internal.profiles.SystemDefaultProfile.onStateUpdateFromHandler(SystemDefaultProfile.java:54) ~[?:?]
at org.eclipse.smarthome.core.thing.internal.CommunicationManager.lambda$9(CommunicationManager.java:477) ~[?:?]
at org.eclipse.smarthome.core.thing.internal.CommunicationManager.lambda$11(CommunicationManager.java:497) ~[?:?]
at java.lang.Iterable.forEach(Iterable.java:75) ~[?:?]
at org.eclipse.smarthome.core.thing.internal.CommunicationManager.handleCallFromHandler(CommunicationManager.java:493) ~[?:?]
at org.eclipse.smarthome.core.thing.internal.CommunicationManager.stateUpdated(CommunicationManager.java:475) ~[?:?]
at org.eclipse.smarthome.core.thing.internal.ThingManagerImpl$1.stateUpdated(ThingManagerImpl.java:167) ~[?:?]
at org.eclipse.smarthome.core.thing.binding.BaseThingHandler.updateState(BaseThingHandler.java:287) ~[?:?]
at org.openhab.binding.knx.internal.handler.DeviceThingHandler.processDataReceived(DeviceThingHandler.java:399) ~[?:?]
at org.openhab.binding.knx.internal.handler.DeviceThingHandler.lambda$11(DeviceThingHandler.java:352) ~[?:?]
at org.openhab.binding.knx.internal.handler.DeviceThingHandler.withKNXType(DeviceThingHandler.java:128) ~[?:?]
at org.openhab.binding.knx.internal.handler.DeviceThingHandler.onGroupWrite(DeviceThingHandler.java:331) ~[?:?]
at org.openhab.binding.knx.internal.client.AbstractKNXClient$1.lambda$0(AbstractKNXClient.java:111) ~[?:?]
at org.openhab.binding.knx.internal.client.AbstractKNXClient.lambda$8(AbstractKNXClient.java:258) ~[?:?]
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) ~[?:?]
at java.util.concurrent.FutureTask.run(FutureTask.java:266) ~[?:?]
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180) ~[?:?]
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293) ~[?:?]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [?:?]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [?:?]
at java.lang.Thread.run(Thread.java:748) [?:?]
Last I tried DPT 5.004, which works. It successfully parses the values the way they are sent.
0 to 0
1 to 1
2 to 2
The KNX2 binding however only allows a change of DPT value if it matches the following format:
position="5.004:GA-SET+<GA-READ"
and stops reading the position if I try either of the following
5.001:GA-SET+5.004:<GA-READ
5.001:GA-SET+<5.004:GA-READ
As a result I now have to use the values 0-255 for moving the rollershutter to 0-100%, which fails for another reason, even if I adjust the Slider element with maxValue=255 to set values between 0 and 255:
$ openhab-cli console smarthome:send myrollershutter 120
Logging in as openhab
Error: Command '120' is not valid for item 'myrollershutter'
Valid command types are:
UpDownType: UP DOWN
StopMoveType: STOP MOVE
PercentType
RefreshType: REFRESH
Or if triggered via the mentioned Slider in basicui:
Received HTTP POST request at 'items/myrollershutter' with an invalid status value '221'.
The only values allowed are 0-100.
At this point I don’t know what else to try. The best way I can think of to solve this, is to allow two different DPT values for rollershutter position set and read GA.
The current source code of the knx binding does not seem to support this, so it would not help if I were to update to the SNAPSHOT release. I tried both 2.4.0 and 2.5.0-M1.
Could someone please take a look?
What I forgot to mention was, that the rollershutters are not exclusively controlled by using OpenHAB, therefore I can’t use the autoupdate feature, which would set the status of the rollershutter to the same value provided by the Slider. Also Switch sitemap elements are also used in OpenHAB, so the rollershutters are mainly controlled using UP/DOWN/STOP.
My item is therefore defined with
autoupdate="false"
Edit1: Fix formatting.
Edit2: Added info regarding autoupdate=false and stopping rollershutters manually.