Outside temp to KNX bus

  • Platform information:
    • Hardware: Raspberry Pi 3B+
    • OS: Raspbian
    • openHAB version: Openhab V2

I am running an KNX system at home and I was trying to display the outside temperature from the openweathermap binding on my KNX touch screen.

The first thing I managed was to read the actual temperature from the KNX bus to my item. I can see the temp on the KNX bus in my Openhab.

Now, I created a rule, wich is updating the same item with the temperature from the weather binding. And this is working as well. But the update from the rule, is not updating the KNX bus with the new temperature.

When I check the karaf log, I see that when I update the item via my rule, I get an ItemCommandEvent and no update to KNX bus, when it is comming from the KNX bus, I get an ItemStateChangeEvent.

What can i do?

item file:

Number  tBuiten                               "TemperatuurBuiten [%.1f °C]"                   <temperature>          {channel="knx:device:bridge:Thermostats:tBuiten", autoupdate="force" }

thing file:

 Type number   : tBuiten         "[APP] Temperatuur Buiten" [ ga="4/1/5"]

 //Type number   : tBuiten         "[APP] Temperatuur Buiten" [ ga="9.001:4/1/5"]

rule file:

rule "buitentempverwerking"
    Time cron "*/5 * * * * ?"
    val double currentTempVal = LocalWeatherAndForecast_Current_OutdoorTemperature.state
    tBuiten.sendCommand(currentTempVal as Number)

karaf log:

11:50:35.033 [INFO ] [smarthome.event.ItemCommandEvent     ] - Item 'tBuiten' received command 9.64 °C

11:49:57.874 [INFO ] [smarthome.event.ItemStateChangedEvent] - tBuiten changed from 9.5 to 9.7

What? No, if you want a binding to send something, in general you send a command to the linked Item.
KNX binding does also support the reverse, sending Item updates, but only for xxx-control type channels.
The channel type here is just number, so send it commands.

But send it appropriate commands. As a plain number channel, it will not handle the units °C that are part of this command.
Edit your rule to send numeric only.

The channel type is correct, right? how do I send the correct command like a plain number only?

I’ve no idea, that’s about your side of the KNX stuff.

It’s probably worth getting some background instead of a copy-paste fix

DELETED my posts, as I (again) mixed the things! :wink:
and as to not confuse later readers, I also delete my earlier post.

sorry bout that.

Thank you, I think I have found it and manage to update KNX via openhab as well.