08.05.2024, 12:55
(This post was last modified: 08.05.2024, 12:57 by manos@dynamitec.)
Hello Admin,
I have to read 173 Analog Inputs (energy monitoring) from a BACnet server and I am looking to do it with a scheduled script that runs every 15'.
I tested this and got a nice table in the log.
Trigger HVAC BACnet Polling (32/0/1) 08.05.2024 13:53:13
* table:
[1]
* table:
["present-value"]
* string: 59932.000000
["id"]
* number: 1
["out-of-service"]
* bool: false
["overridden"]
* bool: false
["identifier"]
* number: 118
["description"]
* string: Mtr - Watervoeding ZKW 15F.. - Cumulated volume
["type"]
* string: analog input
["name"]
* string: B_02'S_EBHVAC'Plt'MtrWa(14)'CumVlm
["fault"]
* bool: false
["in-alarm"]
* bool: false
[2]
* table:
["present-value"]
* string: 5490.000000
["id"]
* number: 2
["out-of-service"]
* bool: false
["overridden"]
* bool: false
["identifier"]
* number: 119
["description"]
* string: Mtr - Voeding verzacht labowater - Cumulated volume
["type"]
* string: analog input
["name"]
* string: B_02'S_EBHVAC'Plt'MtrWa(20)'CumVlm
["fault"]
* bool: false
["in-alarm"]
* bool: false
What I want to achieve is to access only the analog input objects and write the value to a knx group address.
Regards
I have to read 173 Analog Inputs (energy monitoring) from a BACnet server and I am looking to do it with a scheduled script that runs every 15'.
I tested this and got a nice table in the log.
Code:
require('bacnet')
device, objects = bacnet.scandevice(1)
log(objects)
Trigger HVAC BACnet Polling (32/0/1) 08.05.2024 13:53:13
* table:
[1]
* table:
["present-value"]
* string: 59932.000000
["id"]
* number: 1
["out-of-service"]
* bool: false
["overridden"]
* bool: false
["identifier"]
* number: 118
["description"]
* string: Mtr - Watervoeding ZKW 15F.. - Cumulated volume
["type"]
* string: analog input
["name"]
* string: B_02'S_EBHVAC'Plt'MtrWa(14)'CumVlm
["fault"]
* bool: false
["in-alarm"]
* bool: false
[2]
* table:
["present-value"]
* string: 5490.000000
["id"]
* number: 2
["out-of-service"]
* bool: false
["overridden"]
* bool: false
["identifier"]
* number: 119
["description"]
* string: Mtr - Voeding verzacht labowater - Cumulated volume
["type"]
* string: analog input
["name"]
* string: B_02'S_EBHVAC'Plt'MtrWa(20)'CumVlm
["fault"]
* bool: false
["in-alarm"]
* bool: false
What I want to achieve is to access only the analog input objects and write the value to a knx group address.
- Could you provide a nice example of how can I access only the objects with ["type"] analog input and get then the ["present-value"] and write it to the knx bus on the object with the same name as the ["description"] filed?
- Is there a way to use this nice table data and create automatically all KNX objects based on the ["description"] so copy the string and set as name to the knx object? In most cases Units are kWh and l (liters) but I have also °C (temperature) which I would like to recieve as 2byte float in the KNX.
Regards