KNX rule does not work

rules
knx
Tags: #<Tag:0x00007fe058a61e50> #<Tag:0x00007fe058a61b30>

(Thomas Anhoeck) #1

I installes OpenHAB yesterday on a IntelNUC.
On the Paper Interface I defined my KNX Gateway (Thing) and two KNX Devices (Things) and a switch (Item) to put them on and off.Then I connected them. All works fine.

Then I tried to define a rule, using this Things and items to switch on and off These lights depending on time. Saved it to conf/rules file. Does not work!

Did I miss anything like a correct setup or link from the rules to These Things and items?

Here my Testcode:

rule “TEST”

when

time cron ‘0 28 12 ? * MON-SUN’

then

sendCommand(KNX_Test_FL, ON)

end

Test_FL is the Switch Item defined in the Paper Interface which worked properly on the Classical UI.

Next Test, did also not work:

I defined an Item in the conf/items File:
Switch Test_FL “FL Testswitch” () { knx=“1/6/14”}

… and a rule referring to this item:
when

time cron ‘0 28 12 ? * MON-SUN’

then

sendCommand(Test_FL, ON)

end

Thank for help


(Angelos) #2

Welcome! You are running with 100km/h on the new OH2 “highway” :slight_smile: and made some small mistakes.

Test_FL or KNX_Test_FL ? What is the name (not label) of the Item that you created in PaperUI? (the one that works on the control tab of PaperUI)

rule "TEST"
when
	Time cron '0 28 12 ? * MON-SUN'
then
	KNX_Test_FL.sendCommand(ON)
end

Since you are using the KNXv2 Binding, you need to use channel for the binding config (the knx= is the syntax for the older KNXv1 binding)

Read more here:

  1. https://www.openhab.org/addons/bindings/knx/
  2. https://www.openhab.org/docs/configuration/rules-dsl.html
  3. https://www.openhab.org/docs/configuration/sitemaps.html
  4. How to use code fences

(Vincent Regaud) #3

Time with a Capital T

Time cron '0 28 12 ? * MON-SUN'

(Thomas Anhoeck) #4

Oups - thanks :wink:


(Thomas Anhoeck) #5

Many thanks, will test when I am back in a few days. To the item:

Switch Test_FL “FL Testswitch” () {channel1=1/6/14}

… right?

regards
T


(Angelos) #6

wrong :slight_smile:

The channel UID is something like: channel="knx:device:GIRA2167:GW90741_5:Ch_51"

Your example uses the GA which is configured in the Thing. This is already done in PaperUI, so you need to go in the Thing information in PaperUI and copy the channel UID from there and use it in your Items definition.


(Thomas Anhoeck) #7

image
Thanks for your help. I am back to the place of my new installation.
My code looks like this now. I relay on KNX_FL_Switch which I had defined in the paperUI and which has the channel defined. Still no reaction.
I am not a programmer, maybe I missed someting?


(Angelos) #8

Can you post a screenshot of PaperUI showing the thing and the linked items to its channels? (Expand the channel to show the linked items)


(Thomas Anhoeck) #9


(Angelos) #10

Expand plz (2 arrows image all the way to the right on your screenie)

How come the KNX Thing has a Status “Offline” ?


(Thomas Anhoeck) #11

They have always been offline. It is my fourth day I work with OpenHAB. So I am not very experienced. I have an IP KNX Interface with tunneling. This Thing showes online, the Things I have defined “behind” this show offline. I did the binding (channel) between one of the offline KNX Things and the Switch Item in the Paper UI and it worked fine. So my guess was, that OpenHAB cannot “look” behind the IP KNX Interface.
Here how the Things look:


(Angelos) #12

Ok… can you post 3 screenshots please:

  1. One showing the configuration parameters of one of the Offline Things (edit the Thing)
  2. One showing the Channels (expanded with the linked items) of the same Offline Thing as (1) above
  3. One showing the configuration parameters of the main KNX/IP Gateway

Looks to me that you haven’t selected a Bridge for the (offline) KNX Things… double check this in the configuration


(Thomas Anhoeck) #13

Thank you for your time!

Hmm I wonder where I missed to define a Bridge and how to do it respecively.
Thx for your help. Here the 3 sreenshots…




(Angelos) #14

change the info in the red box to an IA (Individual Address aka Physical Address) for the KNX Actuator (format of IA: x.y.z (not x/y/z which is for GA)

The Bridge seems to be configured correctly in the Thing (blue box)


(Angelos) #15

@Udo_Hartmann : We have another documentation issue here :slight_smile:

IA instead of GA

I think that we need another issue on github. I will try to open it up.


(Angelos) #16

I don’t like how this looks:

It seems to me that it is missing the Bridge info
It should be:

knx:device:d3d8df47:3c8ca2b2:Channel1

maybe it is wrong due to the mis-configured IA…


(Thomas Anhoeck) #17

What is IA? How can I fix it?


(Thomas Anhoeck) #18

I understood in the local KNX GA I have to define the KNX GA of the IP KNX Interface which is in my case 1.0.252…


(Thomas Anhoeck) #19

Sorry, first answer was to quickly, I overred some of your inportant inputs: My actuator for this Lights is a DALI Gateway… and now I am a bit lost in the KNX DALI world. This DALI Gateway serves many Lights and honestly, I do not know what KNX sends, that only lights are affected I like to cover.
Anyway, I have defined the IA (which is for both Ligths the same DALI Gateway) and they turned to online now.


I just wonder why it worked fine with a Paper UI defined switch even if the IA was wrongly defined in the Thing.

I have also corrected the KNX/IP Gateway to a GA 1/0/252


(Thomas Anhoeck) #20

I have deleted and newly defined the Thing with IA and the channel. It is now online but the channel information still looks the same?!

Back to my original issue: So from Paper UI it agein works, but not from a rule.
I just saw that OpenHAB starts with an error:


I run under Windows 10 and red somewhere thet tinyb is not available, so I ignored…