vapourismo / knx-go

KNX clients and protocol implementation in Go
MIT License
91 stars 59 forks source link

Query value-status of a group address #65

Closed rltsv closed 1 year ago

rltsv commented 1 year ago

Hi!

Is it possible to implement a status query of all group addresses connected to the gateway? Or, for example, without waiting for the status change, just request the current value of the group address?

At the moment, we get the status value only by changing it.

mobilarte commented 1 year ago

I assume that you have the list of configured group addresses. If you send a GroupRead event to a group address, you should get a reply (GroupResponse) from one of the devices that uses the address. See also GroupValueRead: from the bus for more details about which device will reply.

vapourismo commented 1 year ago

As @mobilarte has pointed out, the network doesn't freely tell you which addresses are allocated, unfortunately. That means you would need to know every used address upfront.

With enough time you could brute force query every possible address upfront. Not a good idea IMHO though.

If you have all the addresses in question, you can issue GroupValueReads for each of them. That would give you an asynchronous stream of values for each of them.

rltsv commented 1 year ago

Thank you!