04.04.2017, 07:35
Hi,
I need to check the current status of a data object, as a condition in an if-then-elseif.
Having the correct and current (at the exact moment of the request) status is an absolute requirement.
I use grp.read() but since this function returns immediately, the script does not await the response of the bus and continues. Any checks on the status are therefore not usable.
I read a post (I believe from admin), stating to put a os.sleep(2) after the read request in order to give the knx bus the time to put the answer to the request on the bus.
However, I can imagine something can go wrong and the status gets lost or takes longer then 2 seconds to get to the requesting script, meaning this is not a 100% reliable and slow method
Waiting longer then 2 seconds is not really an option (2 seconds is actually already pretty long) since actions to be taken would take too long to activate and possibly, the status of the object has changed in the meantime due some other bus command.
So, my question : is there a way to get the current status of a knx object and be able to use it immediately in a condition check, without delay?
Thanks for your advice.
Hendrik.
I need to check the current status of a data object, as a condition in an if-then-elseif.
Having the correct and current (at the exact moment of the request) status is an absolute requirement.
I use grp.read() but since this function returns immediately, the script does not await the response of the bus and continues. Any checks on the status are therefore not usable.
I read a post (I believe from admin), stating to put a os.sleep(2) after the read request in order to give the knx bus the time to put the answer to the request on the bus.
However, I can imagine something can go wrong and the status gets lost or takes longer then 2 seconds to get to the requesting script, meaning this is not a 100% reliable and slow method
Waiting longer then 2 seconds is not really an option (2 seconds is actually already pretty long) since actions to be taken would take too long to activate and possibly, the status of the object has changed in the meantime due some other bus command.
So, my question : is there a way to get the current status of a knx object and be able to use it immediately in a condition check, without delay?
Thanks for your advice.
Hendrik.