[knx2] Issue with Scene Number

Any news on this topic? As far as I can see, the DPT ist still delivered as decimal (x.0)…

I was trying to play around with some workarounds, but neither worked…maybe I have errors in the syntax?

var Scene_Value = (Scene.state as DecimalType).intValue

//guessing that Scene_Value can't be used as a trigger first...
rule "Szene 1 Guten Morgen"

when

Item Scene received update

then

if {Scene_Value.state == 0}

HueColorCandle1Color.sendCommand ("30,64,80")

HueColorCandle2Color.sendCommand ("30,64,80")

HueColorCandle5Color.sendCommand ("30,64,80")

end

//Trying to use the Scene_Value directly...
rule "Szene 2 Gute Nacht"

when

Item Scene_Value received command 1

then

HueLightstripPlus1Dimmer.sendCommand (OFF)

HueColorCandle1Dimmer.sendCommand (OFF)

HueColorCandle2Dimmer.sendCommand (OFF)

HueColorCandle5Dimmer.sendCommand (OFF)

//SteckdoseTreppenhausOben.sendCommand (OFF)

SteckdoseFP1.sendCommand (OFF)

end

//Tried to use the floating point decimal the binding delivers (in this case I would have simply had two rules, depending on what triggered the rule
rule "Szene 3 Chillen"

when

Item Scene received command 2.0

then

HueColorCandle1Color.sendCommand ("29,80,70")

HueColorCandle2Color.sendCommand ("29,80,70")

HueColorCandle5Color.sendCommand ("29,80,70")

end

All three versions did not work… any ideas ?

I haven’t tried again, but I’m on stable release, so not sure KNX binding has updates (I still use legacy KNX binding also). Let me know if more recent versions do fix some of the above issues.

cheers
phil

I am on the latest snapshot, so obvisously there hasn’t been any fixes :frowning:

i would think there should be some changes in the knx binding of the latest snapshot releases, no?

Nothing I would have noticed (haven’t searched for changes in the documentation). My workaround so far ist to have rules duplicated like this (Szene 1 is triggerd when using the sitemap, Szene 1a is triggerd when received from the KNX bus):


rule "Szene 1 Guten Morgen"

when

Item Scene received update 0

then

HueColorCandle1Color.sendCommand ("30,64,80")

HueColorCandle2Color.sendCommand ("30,64,80")

HueColorCandle5Color.sendCommand ("30,64,80")

end

rule "Szene 1a Guten Morgen"

when

Item Scene received update 0.0

then

HueColorCandle1Color.sendCommand ("30,64,80")

HueColorCandle2Color.sendCommand ("30,64,80")

HueColorCandle5Color.sendCommand ("30,64,80")

end

I am sure there are more elegant ways to code this, but I am not a developer, so this works for me for the time being…

Sure.

Use a less special trigger and use the state:

rule "Szene 1 Guten Morgen"
when
    Item Scene received update
then
    var Number iScene
    if(!(Scene.state instanceof Number)) return;
    iScene = (Scene.state as Number).intValue
    switch (iScene) {
        case 0: {
            // Scene 0
        }
        case 1: {
            // Scene 1
        }
        case 2: {
            // Scene 2
        }
    }
end

Cool, thanks a lot!

@Udo_Hartmann: do you know by any chance if the x.0 still exists for dpt 5.010, 20.102 etc. I‘m always getting errors in the log, when trying to map the values, when System trying to send back values etc.

Thanks in advance for some hints

Best regards
Rolf

Same question here, in a live environment i’m still on knx 1.13

In knx 2.4 if using DPT 17.001, does it still show as a x.0 number or integer?

afaik there was no change in question of wrong interpretation as float instead of integer.

Hi,

I’m trying to get scenes from KNX working via Openhab (raspberri Pi, openHAB 2.5.0 Release Build)

things:

 Type number       : Scenes_Living_Keuken             "Scenes Living Keuken           "            [ ga="5.010:3/1/0"]  your code goes here

item:

Number   ScenesLivingKeuken                     "Scenes living keuken"                                                     {channel="knx:device:bridge:dummy:Scenes_Living_Keuken"}

sitemap:

Switch item=ScenesLivingKeuken label="Scenes gelijkvloers" mappings=[0="TV kijken", 1="Eten aan Living Tafel"]

when I select via BasicUI the scens, I receive the correct Group-adress in KNX/ETS but the datapointtype is incorrect. and KNX does not react on the info.

see extract below. first input is scenes selection from OH and no reaction on the bus. 2e line is the same scene selection from KNX/ETS

any help? how can I add the correct datapoint type?

thanks

Did you try different DPT types? like 17.001? not sure on this, I’m still on the KNX binding v1 because of this reason :slightly_smiling_face:

Yes I tried 17.001 18.001 and several other. but it seems like OH doesn’t take into account the specified DPT. in my code above I still had 5.010 as DPT. this was also one I tried but no succes

each entry from OH comes into ETS/KNX but does not trigger any reaction

I believe that’s what I struggled with 2yrs ago, when I tried to convert to KNX binding v2. It was such a cumbersome task that I stayed (until now) with binding v1. But there must be a way to get a scenenumber over to KNX I guess? I believe Udo had a way? but haven’t tried it anymore since

A few questions:

  • Can you post your full .things file?
    Maybe the channel in your .items file is not right.

  • Do you get any errors in the logs?
    When I was working with my knx scenes a did something wrong, most of the time the log messages helpt me.

  • Looking at your bus monitor it posts messages with DPT 17.001, so your openhab thing should expect 17.001 values

  • You are translating a scene number to a Switch in your .sitemap via a mapping that translates it to text. This is not gonna work I thing :wink:
    Better change “Switch” to “Text” in your sitemap to see the result of the mapping

Hi Arie,

See below some comments to your question. However for a unknown reason, it works for now. No real change was made to OH config files, and when I tried again to select a scene in OH today, KNX reacts. When I select a scene via OH, it transfers the message to KNX (just as before). the DPT is now “5.* 8-bit unsigned value” and not 17.001 as specified in OH-files; However KNX reacts to it and does what needs to be done. see screenshot

my entire things file is long and not completely finished. still work in progress. but below is what is relevant for this topic

Thing device dummy "Dummy" [ address="1.1.81", fetch=false, pingInterval=300, readInterval=0 ]  // dummy adres van een schakelaar toegewezen
		    {
	             Type number        : TemperatuurlivingRaam          	"Temperatuurlivingraam        "         [ ga="9.001:<3/0/8"]
               Type number       : Scenes_Living_Keuken             "Scenes Living Keuken           "            [ ga="17.001:3/1/0"] 
        }
     

3/1/0 is the Groupadress for the scenes in KNX

which logs do you mean? in OH (tail -f /var/log/openhab2/openhab.log /var/log/openhab2/events.log) no error messages. in KNX: I never looked at logs.only at group monitor

I would expect this as well. I tried with a lot of different DPT. even now, DPT 17.xxx was selected and KNX receives an other DPT. see screenshot above

it works. see how classic UI shows this:

However my goal was to use selector in the sitemap, but since it didn’t work at first, I tried a switch with mappings (since I allready use this for other purposes)

when I use the selector now, I t works as well

Frame label="Test" {

    Selection item=ScenesLivingKeuken label="Scenes gelijkvloers" mappings=[0="TV kijken", 1="Eten aan Living Tafel", 2="Koken", 3="Eten in de keuken", 4="Party Mode"]

    //Switch item=ScenesLivingKeuken label="Scenes gelijkvloers" mappings=[0="TV kijken", 1="Eten aan Living Tafel"]

    }

So the only issue I have now is how stable is this? and why doesn’t the correct DPT is transferred

Strange that it works now, but ok!
More strange is that it somehow translates a scene number (17.001) to a unsigned value (5.*) with value 0% (see selected line in monitor screenshot).
What is the DPT of the group address in ETS?

I dit mean the openHab logs indeed. In my cases the logs showed errors when my config was wrong.

Really? Didn’t know that, learned something new!

Hi,

the DPT was 8-bit unsigned value

but when I change it now mannually in ETS to 17.001, He shows it as 17.001.

best regards

And now the value shows as 3, which matches your scene “Eten in de keuken”?

Hello,

I would like to revisit this.

I’m trying to get OH working with KNX and a KNX-DALI interface.
The DALI controller has a parameter that default is set to the datatype 18.001 “scene control” but I changed it to 17.001 “scene number” since I only want to SET the scene, not STORE.

I linked this parameter to a GA 1/7/0 with the name “openhab_scene” and als set this GA also to the datatype 17.001

In paperui I defined a channel “knx:device:39a3262a:openhab_scene” with the GA set to 17.001:1/7/0

sitemap

Selection item=ScenesLivingKeuken label=“Scenes gelijkvloers” mappings=[1=“1 TV kijken”, 2=“2 koken”, 3=“3 beneden alle licht uit”]

items

Number ScenesLivingKeuken “Scenes living keuken” {channel=“knx:device:39a3262a:openhab_scene”}

What I see now is that these values are received when I look into ETS

It seems that when I send I receive (after the ->)
1 -> $01 | 2
2-> $02 | 3
3-> $03 | 4

What is the meaning of this notation? ($01 | 2)
I have the impression that when I select 1 in openhab scene 2 is selected in KNX (and on the DALI interface)

[DEBUG] [nx.internal.client.AbstractKNXClient] - Wrote value ‘2’ to datapoint ‘command DP 1/7/0 ‘knx:ip:2fe6cbfa’, DPT id 17.001, low priority’ (0. attempt).
[DEBUG] [nternal.profiles.ProfileCallbackImpl] - Delegating update ‘2’ for item ‘ScenesLivingKeuken’ to handler for channel ‘knx:device:39a3262a:openhab_scene’

can somebody help me?
thank you!