Some knx sensor states not restored on HA startup

Since moving my HA installation from a synology nas to a RPi2 some knx sensors and binary sensors don’t restore their states on startup, but only after some time. Some failing reads throw warnings like the following, but obviously not all:

2018-11-26 14:38:05 WARNING (MainThread) [xknx.log] Could not read value of <Sensor name="EG Küche Herd Stromwert" sensor="None/GroupAddress("2/1/82")/None/None" value="None" unit="mA"/> 2/1/82
2018-11-26 14:38:06 WARNING (MainThread) [xknx.log] Could not read value of <Climate name="EG Küche Temperatur Raum" temperature="None/GroupAddress("5/2/10")/None/None"  target_temperature="GroupAddress("5/2/11")/None/None/None"  setpoint_shift="None/None/None/None" setpoint_shift_step="0.5" setpoint_shift_max="6" setpoint_shift_min="-6" group_address_operation_mode="GroupAddress("5/2/13")" group_address_operation_mode_state="GroupAddress("5/2/14")" group_address_controller_status="None" group_address_controller_status_state="None" group_address_controller_mode="None" group_address_controller_mode_state="None" group_address_on_off="None/None/None/None" /> 5/2/10

The state of a device gets updated in HA as soon as HA receives a telegram for this device from the knx bus. For devices which are configured to periodically push their states to the bus, this usually happens after a couple of minutes. But devices not sending their state periodically aren’t updated until their state changes or if writing a telegram to the bus is triggered, f.e. by manually reading the group address value from the ETS application.

As the RPi is significantly slower than the synology I suspected, that this may be a performance issue. HA is pushing out a lot of read requests on startup. So maybe it misses some responses because of a lack of performance.

But I’m not sure if this is what’s really happening. When issuing a restart in debug mode and tracking the communication in HA and ETS, I’m observing that HA doesn’t even try to retrieve values for some of the affected sensors.

On startup HA obviously tries to read temperature and current sensors. But I have some binary sensors and switches whose group addresses neither show up in the HA debug log, nor in the ETS bus monitor. It seems that HA doesn’t even try to restore their values.

Is this a known issue? Am I missing something? Is there some configuration I can add or tweak to get reliable states for all knx sensors on startup?

I don’t know if you figured it out, but for someone looking for answer to this problem I’ll post a solution. You simply need to specify state_address in addition to simple address of a KNX actor, then you will be able to see actual state even after home assistant restarts. You can use the same address, if a device doesn’t have separate one (I don’t know if any of them does).

There were two or three bugs in xknx regarding inconsistencies in handling knx set and state addresses which lead to the described behavior. Especially states of knx binary sensors were never updated on startup: https://github.com/XKNX/xknx/pull/199

These issues have already been fixed in the xknx repo some weeks ago, but unfortunately these changes weren’t merged to the HA repository until now.

Edit: It seems, the bug fixes are finally on their way to HA: https://github.com/home-assistant/home-assistant/pull/24738

I’m running into the same issue; especially - as you mentioned - with binary sensors (motion sensors).
Will be happy to see if the proposed pull request fixes the problem.