KNX Group-Read feature of xKNX

I am having an KNX power supply system with some diagnostic functions from MDT and I want to integrate some status information from that system to my Home-Assistant UI.

Is there an build in way to query group adresses like as you do with the knx.send service?
My problem is that the information I want to access is not pro-actively shared on the bus and I have to actively query it but I cannot find a proper way to do so.

1 Like

Is it worth a feature request? Is there a proper place for feature requests?

1 Like

Hi Markus,

You mean that you want to see the status after a restart of the HA server?
So I have my alarm armed and see it on a 6 way input module of knz (mdt) .
After a reboot of the system I doesn’t see him anymore until I switch the alarm on and off.

Is that the same issue?

Did you check if the flag R is enable in the status of the actuators?
When the HA ask for the status, if the flag R is not enable, the actuator does not send the status.

Hi Markus,
at the moment I’m building my house, with KNX. I was just thinking about some usecases for HA and one of them could be to control the brightness of a light by reading an illuminance sensor. There I think I will face the same problem: The sensor can send its value regularly, but minimum time is 30s - If I switch on the light, I want to get the sensor value as fast as possible, with 30s delay I cannot control anything. That’s why I would like to actively read the value from the sensor after turning on the light.
And I think there are devices that do not even have the option of sending regularly. Therefore such a read feature would be great.

I think the right place for a feature request would be here:
https://community.home-assistant.io/c/feature-requests

The topic was discussed here, but the threat drifted in another direction:

There is a custom component that should do this, but I did not test it yet:

If that works a intended, I think the feature could be integrated in the HA KNX component. At least that’s what I hope…

This is working. You need to change a few things in code, at least I have to do it. But you can use that service to call an group address.

Here is what I changed in the function:

def service_read_from_knx_bus(call):
        """Issue read request to the bus."""
        from xknx.core import ValueReader
        from xknx.knx import GroupAddress
        attr_address = call.data.get(SERVICE_KNX_ATTR_ADDRESS)
        knx_address = GroupAddress(attr_address)
        _LOGGER.info("Reading data from KNX GroupAddress: <%s>", knx_address)

        value_reader = ValueReader(hass.data[DATA_KNX].xknx, knx_address)
        #hass.states.set('knx_reader.read', value_reader.read()
        yield from value_reader.read()
        _LOGGER.info("ValueReader status: <%s>", value_reader.success)
        _LOGGER.info("Telegram: <%s>", value_reader.received_telegram)
        _LOGGER.info("Telegram payload value: <%s>", value_reader.received_telegram.payload.value)

This is not failsafe because there is no check if an telegram is received but for me it works right now.

By default every state_address is read on startup and then once an hour.

Feature requests are probably best seen in github xknx issues

@der-optimist all of my knx devices send values to the bus if they change internally (eg. light is dimmed up - some telegrams are sent). Additionally I can configure them to send periodically, but this is hardly ever necessary.