home-assistant / core

:house_with_garden: Open source home automation that puts local control and privacy first.
https://www.home-assistant.io
Apache License 2.0
72.62k stars 30.38k forks source link

KNX Weather item doesn't create binary sensors anymore #62606

Closed cyberjunky closed 2 years ago

cyberjunky commented 2 years ago

The problem

Even when you configure a KNX Weather item with it's full config schema, there are no binary sensors created. Like the alarms, and day_night binary sensor.

What version of Home Assistant Core has the issue?

core-2021.12.4

What was the last working version of Home Assistant Core?

No response

What type of installation are you running?

Home Assistant OS

Integration causing the issue

KNX

Link to integration documentation on our website

https://www.home-assistant.io/integrations/knx/#weather

Example YAML snippet

knx:
  weather:
    - name: "Weerstation"
      address_temperature: "4/3/0"
      address_brightness_north: "4/3/2"
      address_wind_speed: "4/3/4"
      address_rain_alarm: "4/3/5"
      address_frost_alarm: "4/3/6"
      address_wind_alarm: "4/3/1"
      address_day_night: "4/3/3"
      sync_state: true

### Anything in the logs that might be useful for us?

```txt
Group addresses are read succesfully;

<KNXIPFrame <KNXIPHeader HeaderLength="6" ProtocolVersion="16" KNXIPServiceType="TUNNELLING_REQUEST" Reserve="0" TotalLength="25" />
body="<TunnellingRequest communication_channel_id="1" sequence_counter="239" cemi="<CEMIFrame SourceAddress="IndividualAddress("1.1.6")" DestinationAddress="GroupAddress("4/4/4")" Flags="1011110011100000" code="L_DATA_IND" payload="<GroupValueWrite value="<DPTArray value="[0x43,0xd7,0x0,0x0]" />" />" />" />" />
2021-12-22 14:44:10 DEBUG (MainThread) [xknx.knx] Sending to 192.168.x.x:3671 at 1640180650.0765932:
<KNXIPFrame <KNXIPHeader HeaderLength="6" ProtocolVersion="16" KNXIPServiceType="TUNNELLING_ACK" Reserve="0" TotalLength="10" />
body="<TunnellingAck communication_channel_id="1" sequence_counter="239" status_code="ErrorCode.E_NO_ERROR" />" />
2021-12-22 14:44:10 DEBUG (MainThread) [xknx.telegram] <Telegram direction="Incoming" source_address="1.1.6" destination_address="4/4/4" payload="<GroupValueWrite value="<DPTArray value="[0x43,0xd7,0x0,0x0]" />" />" />
2021-12-22 14:44:11 DEBUG (MainThread) [xknx.raw_socket] Received from ('192.168.x.x', 3671): 0610042000150401f0002900bcc031082303010081
2021-12-22 14:44:11 DEBUG (MainThread) [xknx.knx] Received from 192.168.x.x:3671 at 1640180651.3744152:
<KNXIPFrame <KNXIPHeader HeaderLength="6" ProtocolVersion="16" KNXIPServiceType="TUNNELLING_REQUEST" Reserve="0" TotalLength="21" />
body="<TunnellingRequest communication_channel_id="1" sequence_counter="240" cemi="<CEMIFrame SourceAddress="IndividualAddress("3.1.8")" DestinationAddress="GroupAddress("4/3/3")" Flags="1011110011000000" code="L_DATA_IND" payload="<GroupValueWrite value="<DPTBinary value="1" />" />" />" />" />
2021-12-22 14:44:11 DEBUG (MainThread) [xknx.knx] Sending to 192.168.x.x:3671 at 1640180651.3746808:
<KNXIPFrame <KNXIPHeader HeaderLength="6" ProtocolVersion="16" KNXIPServiceType="TUNNELLING_ACK" Reserve="0" TotalLength="10" />
body="<TunnellingAck communication_channel_id="1" sequence_counter="240" status_code="ErrorCode.E_NO_ERROR" />" />
2021-12-22 14:44:11 DEBUG (MainThread) [xknx.telegram] <Telegram direction="Incoming" source_address="3.1.8" destination_address="4/3/3" payload="<GroupValueWrite value="<DPTBinary value="1" />" />" />
2021-12-22 14:44:11 DEBUG (MainThread) [xknx.raw_socket] Received from ('192.168.x.x', 3671): 0610042000150401f1002900bcc031082305010080
2021-12-22 14:44:11 DEBUG (MainThread) [xknx.knx] Received from 192.168.x.x:3671 at 1640180651.5799818:
<KNXIPFrame <KNXIPHeader HeaderLength="6" ProtocolVersion="16" KNXIPServiceType="TUNNELLING_REQUEST" Reserve="0" TotalLength="21" />
body="<TunnellingRequest communication_channel_id="1" sequence_counter="241" cemi="<CEMIFrame SourceAddress="IndividualAddress("3.1.8")" DestinationAddress="GroupAddress("4/3/5")" Flags="1011110011000000" code="L_DATA_IND" payload="<GroupValueWrite value="<DPTBinary value="0" />" />" />" />" />
2021-12-22 14:44:11 DEBUG (MainThread) [xknx.knx] Sending to 192.168.x.x:3671 at 1640180651.5802362:
<KNXIPFrame <KNXIPHeader HeaderLength="6" ProtocolVersion="16" KNXIPServiceType="TUNNELLING_ACK" Reserve="0" TotalLength="10" />
body="<TunnellingAck communication_channel_id="1" sequence_counter="241" status_code="ErrorCode.E_NO_ERROR" />" />


### Additional information

In older versions a 'create_sensors: True' value was implemented, but it was deprecated, maybe this has something to do with it.
probot-home-assistant[bot] commented 2 years ago

knx documentation knx source (message by IssueLinks)

probot-home-assistant[bot] commented 2 years ago

Hey there @julius2342, @farmio, @marvin-w, mind taking a look at this issue as it has been labeled with an integration (knx) you are listed as a code owner for? Thanks! (message by CodeOwnersMention)

marvin-w commented 2 years ago

Yes, you are absolutely right, this was working at some point but it was dropped for compatibility reasons. You will have to create the sensors yourself and then it will work as expected.

farmio commented 2 years ago

Yes, this is expected. Some of these GAs are only used to calculate the condition string. If you want binary_sensors or sensors too you'll need to configure these separately.

cyberjunky commented 2 years ago

Yes, you are absolutely right, this was working at some point but it was dropped for compatibility reasons. You will have to create the sensors yourself and then it will work as expected.

Why is this dropped? Now you have the code implemented, the documentation is there but not a working situation...

cyberjunky commented 2 years ago

Same for brightness_north? So all a KNX weather item does is temp and windspeed?

marvin-w commented 2 years ago

It did not comply with the Home Assistant standard and would have required workarounds in the long term (now, with a config flow).

It just creates a weather entity and computes the condition. But KNX doesn't support forecasting so yes, that's all it can :).

You can simply create the sensors/binary_sensor with a couple lines of YAML. (including brightness)

niraviry commented 2 years ago

The binary_sensor of version 2021.12.4 is just a part of the problem. Moving from 2021.12.3 to .4 kills the KNX IP router and it is can't connect to the bus anymore. No KNX entities at all in 2021.12.4. The waether is not as it was in previous versions. Movedback and forth few times. 2021.12.2 and 2021.12.3 work OK. Latest is not working.

cyberjunky commented 2 years ago

Typical, I was away from home-assistant for almost a year, it's not what it was anymore.. Had the same 'not a HA standard' discussions with my custom build integrations, no fun anymore, to get something integrated... alas...

marvin-w commented 2 years ago

The binary_sensor of version 2021.12.4 is just a part of the problem. Moving from 2021.12.3 to .4 kills the KNX IP router and it is can't connect to the bus anymore. No KNX entities at all in 2021.12.4. The waether is not as it was in previous versions. Movedback and forth few times. 2021.12.2 and 2021.12.3 work OK. Latest is not working.

https://github.com/home-assistant/core/issues/62467 fixed already and off topic.

Typical, I was away from home-assistant for almost a year, it's not what it was anymore.. Had the same 'not a HA standard' discussions with my custom build integrations, no fun anymore, to get something integrated... alas...

It's as easy as:

- name: Weather.BrightnessEast
  state_address: '7/0/4'
  type: 'illuminance'

- name: Weather.BrightnessWest
  state_address: '7/0/3'
  type: 'illuminance'

- name: Weather.BrightnessSouth
  state_address: '7/0/5'
  type: 'illuminance'

- name: Weather.WindSpeed
  state_address: '7/0/2'
  type: 'wind_speed_ms'

- name: Weather.OutsideTemperature
  state_address: '7/0/1'
  type: 'temperature'
cyberjunky commented 2 years ago

The binary_sensor of version 2021.12.4 is just a part of the problem. Moving from 2021.12.3 to .4 kills the KNX IP router and it is can't connect to the bus anymore. No KNX entities at all in 2021.12.4. The waether is not as it was in previous versions. Movedback and forth few times. 2021.12.2 and 2021.12.3 work OK. Latest is not working.

Same here, that was the other bug I ran into, have 2 standard as it could be KNX routers, and a S1 devices, cannot get them to configure via the gui, not with any combination, only with yaml

knx:
  tunneling:
    host: !secret knx_host

But that going to be deprecated also...

marvin-w commented 2 years ago

The binary_sensor of version 2021.12.4 is just a part of the problem. Moving from 2021.12.3 to .4 kills the KNX IP router and it is can't connect to the bus anymore. No KNX entities at all in 2021.12.4. The waether is not as it was in previous versions. Movedback and forth few times. 2021.12.2 and 2021.12.3 work OK. Latest is not working.

Same here, that was the other bug I ran into, have 2 standard as it could be KNX routers, and a S1 devices, cannot get them to configure via the gui, not with any combination, only with yaml

knx:
  tunneling:
    host: !secret knx_host

But that going to be deprecated also...

The connections settings are in the UI now. You can do everything you need to do there. We did not change the connection logic itself, it maps to the old YAML.

cyberjunky commented 2 years ago

The connections settings are in the UI now. You can do everything you need to do there.

Yes but that doesn't work for me, tried all combinations. Good to see the bug (I think I have) is already fixed for next release.

cyberjunky commented 2 years ago

Maybe update the documentation of KNX Weather, and remove the sensor code, why specify all the stuff while it doesn't do anything anyway.

cyberjunky commented 2 years ago

Last remark, then ticket can be closed, is there a discord or other comm. channel for KNX/HA related discussions?

marvin-w commented 2 years ago

The documentation is up to date. I don't see any create_sensor there. There was a breaking change (documented in the changelog) a while ago (like, really a while).

The states are used to compute the condition string.

Yep, you can join xknx here: https://discord.gg/EuAQDXU

marvin-w commented 2 years ago

Be sure to create a sensor and not a binary_sensor.