DALI lamp status on KNX bus through LogicMachine
Example: DALI lamp status on KNX bus through LogicMachine
Task
The DALI bus is a fieldbus which is designed to control DALI objects from one location. In case DALI sensors or switches are used, you might need to see the current light level of DALI ballast. In this case, additionally to DALI to KNX mapper, you have to add a resident script which will communicate with a specific DALI ballast, retrieve the current light level and write it into KNX group address (DALI ballast status object).
Resident script
Add the following script. It will connect to DALI ballast with address 0 and write its status into grp address 5/0/1. Do not use the same object for control and status as it might create an endless loop.
- require('user.dali')
- res = dalicmd('internal', 'queryactual', { addrtype = 'short', address = 0 })
-
- if res then
- curr = res:byte()
- if curr ~= prev then
- grp.update('5/0/3', math.floor(curr / 2.54))
- prev = curr
- end
- end