KNX integration weatherstation - Day = 0 and night = 1

I’m using the KNX integration for integrating my KNX Weatherstation with the follow YAML code:

knx:
  weather:
    - name: "Home"
      address_temperature: "7/0/0"
      address_brightness_south: "7/0/1"
      address_brightness_west: "7/0/2"
      address_brightness_east: "7/0/3"
      address_brightness_north: "7/0/11"
      address_wind_speed: "7/0/4"
      address_rain_alarm: "7/0/5"
      address_frost_alarm: "7/0/6"
      address_wind_alarm: "7/0/7"
      address_day_night: "7/0/8"
      address_air_pressure: "7/0/9"
      address_humidity: "7/0/10"
      sync_state: true

But i’m using the day/night object in an opposite way (Day=0 and Night =1). Then I can use it also directly in a KNX group address for switching lamps ON at night. But Home Assistant thinks now At night that it’s Day and the other way around.

Is there a way to specify within the Yaml code that Day=0 and Night=1?

Hi :wave:!

Its not supported directly. KNX specification defines it that way.

You may use KNX internal inversion and a new GA. Or use a HA binary_sensor and an automation to invert it and send it to the bus with knx.send service. Or an inverted binary_sensor and expose it. (Maybe even use an xknx internal-GA).

Sorry i’m a real beginner in Home Assistant. For me it’s important that KNX works as stably as possible, and it doesn’t depend on Home Assistant to turn lights on/off when night falls.

I can only set the KNX object in 1 way and since a 1 value is also an ON value for my switching actor, this works perfectly.

Does Home-Assistant have an option to adjust this value at the weather station?

If I create a Binary sensor with invertion within Home Assistant, it won’t get to the “weather map”, right?

Many KNX actuators provide simple logics eg. for inverting binary payloads. You can use this to react on your existing GA and send the inverted signal to a new GA.

Same can be done with HA (in many different ways). Here is an example:
Set up a HA KNX event and use the HA knx_event event as trigger for an automation.

trigger:
  - platform: event
    event_type: knx_event
    event_data:
      destination: "1/2/3"

Use the event trigger payload data trigger.event.data.data, invert it in a template and send it back to the bus to a new GA with knx.send.

Use this new GA in the configuration of your weather entity. (syncing the state will fail - but that’s solveable with either expose or a more advanced automation).

Thats an option too (but creates an additional HA entity). Use expose to directly send that binary sensors state to the bus again (to a new GA). The weather entity will feed from this GA then.

All this can be done with “internal GAs” too - if you don’t want to have HA send the inverted state to the bus, but just process it internally. Just use some string prepended by “i-” as GA (eg. “i-inverted-day-night”).