Has anyone encountered problems with knx scene numbers?
My Thing Channel:
Type number-control : scene1 "Lichtszene" [ga="17.001:3/0/0"]
My Item:
Number Virtuelle_Scene1 "Lichtszene" {channel="knx:device:bridge:Virtuell:scene1"}
If setting the scene to something by using a knx scene button, openHAB complains about wrong number format:
2018-04-26 22:51:54.352 [WARN ] [.internal.handler.DeviceThingHandler] - An error occurred on channel knx:device:bridge:Virtuell:scene1: 17.001 Scene Number: wrong value format: 3.0
tuwien.auto.calimero.KNXFormatException: 17.001 Scene Number: wrong value format: 3.0
at tuwien.auto.calimero.dptxlator.DPTXlator.newException(DPTXlator.java:505)
Where does the .0 come from? Do I have to configure something additional to get a Number Item which is of type Integer?
almost the same problem here.
Actually it was exactly the same, as long as I configured via textfiles as you did and got a little better by using PaperUI (dont know why).
But I also get always something like SCENENR**.0** and there is no chance in my rules to cast it to any other type like DecimalType.
I have the same problem. Just spend whole afternoon rewriting my knx.items / knx.things files. Everything seems to work but I control most lighting in house with scenes. When I send a scenenumber from openhab nothing happens.
knx.things:
Type number : AlgemeneScene "SCENE ALGEMEEN" [ga="17.001:1/5/1"]
knx.items:
Number AlgemeneScene "SCENE ALGEMEEN" {channel="knx:device:bridge:scene:AlgemeneScene"}
Rules:
sendCommand(AlgemeneScene,9)
the last one would activate scene number 10 in knx bus on previous version. Iām kinda stuck. wish I could roll back to previous version.
I didnāt get an satisfying answer yetā¦ But I didnāt raise this issue yet, as I experienced a more severe āerrorā (well, turned out, that some optional configuration isnāt optional under certain circumstances, even though it was optionalā¦)
Mmmā¦ looks like Iāll be staying on KNX v1 then for now, running OH stable version 2.3 since itās a live environment, hopefully your āerrorā gets sorted out as wellā¦
Well, in fact, knx2 is very strict in configuration, so, if you know, what to keep in mind, it should work nice and smooth.
But in question of scene number, this isnāt solved yet - but maybe I also have to make a special configuration, who knows?
For what I tested, knx2 worked like a charmā¦ besides my scenes and most of our automation rules use scenes to control lights etc. I tried different DPT just to see if scene numbers would arrive on the bus in different format or so, but couldnāt get it working. Mixing v1 and v2 sounds a bit like looking for trouble though but let me know if it works
Depends on your hardware connection to the knx bus I suppose.
I use a knx ip tunnel which is able to open up to 4 tunnels to the knx bus.
This alllows me to use ETS, knx1 and another knx2 connection at the same time.
Means, for me it works.
I have still the same problem. If I use the datatype 17.001 for KNX scenes I got the same exception. But I was able to use this value in rules. If I set up scene 1 in KNX the exception tell me āwrong value format: 0.0ā. So I had to be careful because of that. I think in your example you are using scene 4. (wrong value format: 3.0).
And if I pressed the button for teaching (normal the scene number will be 1+64) I also got the value of 0.0. So I was not able to decide if somebody runed scene or teached scene.
If I use the datatype 18.001 (I want to learn in scenes as well) I get a KNXFormatException, too. I wrote a topic some time ago.
Hope someone can fix it, because I am still not able to use scenes at home.
There is definitely an issue, 'cause when defining a number channel with DPT 17.001, every received integer is changed to float. And openHAB complains about itselfā¦
But the Number is received and stored. Iām also able to send a scene command through the same channel by using an Integer.
The ETS will display the Scene Number as 1 to 64, while the knx bus will transport the
Scene Number as 0 to 63!!!
This is due to the fact, that Scene Number is defined as a 6Bit value:
DPT 17.001(Scene Number): rrUUUUUU (8bit Value, the two MSB have to be 0)
DPT 18.001(Scene Control): BrUUUUUU (8bit Value, the second MSB has to be 0) B is for
0 -> Recall or
1 -> Store
So itās obvious that when switching to āScene 1ā openHAB will receive a 0. This is correct.
Thats true, the scene is changed to float (DPT 17.001), but I am able to use it in rules.
With the DPT 18.001 I am not able to use it anymore. The logfile will trace the correct scene number (Scene 1 in ETS -> data=ā0x00ā or data=ā0x80ā for learning in). But I am not able to use it in rules. The Exception will break the program before. This is the biggest problem actual for me. I checked out the source code and with a small change I was able to use it. I am not sure if it is a bug or if I am using the DPT 18.001 in a wrong way.
All the stuff with scenes was working very nice with KNX1. So I hope it could be fixed for KNX2 soon.
Jep, As I never used DPT18 within openHAB myself, this part was only from the knx sheets
In theory, the code should be something like that:
Type number : scene "Scene" [ ga=18.001:1/2/3 ]
Number myScene "Scene [%d]" { channel="...:scene" } // store or recall scene
Switch setScene "Store Scene"// set to ON to store
Number mySceneNumber "scene Number to store is [%d]" // knx-scene - 1
rule "set scene"
when
Item setScene received command ON
then
if(mySceneNumber.state instanceof Number) {
if (mySceneNumber.state >= 0 && mySceneNumber.state <= 63 ) {
myScene.sendCommand((mySceneNumber.state as Number) + 128) // maybe ...state as Number).intValue + 64
}
}
setScene.postUpdate(OFF)
end
Thanks for your example. With this code it is maybe possible to set and learn scenes via openhab. I didnĀ“t try yet because the onliest thing I need to do is to get the information if someone pressed the KNX button for scenes for setting or learning it. So I donĀ“t need to set it from openhab, I just need to react in rules.
Set up channel 15 in Paper UI: "Number control" 18.001:15/1/0
Number SzeneOff "Scene Off" {channel="knx:device:KNXToRaspbi:15"}
rule "sceneOff"
when
Item SzeneOff received command
then
logInfo("Szene OFF", "Command received ")
if(SzeneOff.state == 9)
{
// Do something, e.g. set Hue components, Z-Wave...
}
end
So the onliest thing I want to do to pass the command of Scene On/Learn to openhab to switch on/remember state of none KNX components (hue). Because actual I am only able to use scenes just with KNX components.
But the log entry āScene off, Command receivedā in my example is not shown actual, because the exception will appear before.
Translator couldn't parse data for datapoint type '18.001' (KNXFormatException).
Ignoring KNX bus data: couldn't transform to any Type (destination='15/1/0', datapoint='command DP 15/1/0 'knx:device:KNXToRaspbi', DPT id 18.001, low priority', data='0x09')
I am not sure what I should configurate differently. I tried out to use āNumberā and āNumber Controlā in the Paper UI. Both with the same result.