INFO: Howto connect to a device when discovery not possible - Solution #487
roshanl
started this conversation in
Show and tell
Replies: 1 comment
-
I'm glad you found a solution. Use Router
By doing so, the app is now aware of this network and will make requests to the routers to get to it. Read vs DeviceRegarding this part :
You don't need to create the
Not creating the device will accelerate your app if you don't need it |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
import asyncio
import BAC0
async def main():
# Define the BACnet device details
device_id = 61105
mac_address = '5' # Ensure this is a string
network_number = 95
router_ip = '10.10.57.12'
pc_ip = '10.10.57.220'
remote_address=f'{network_number}:{mac_address}@{router_ip}' #https://github.com/JoelBender/BACpypes3/blob/48b8575b3fb91216acc474bb097e71caede577a4/doc/source/gettingstarted/addresses.rst
#route_aware address patterrn used for remote address
#Can also do a readmultiple (Tested with an Alerton BMS and on an FCU controller)
_rpm = {'address': remote_address,
'objects': {
'analogValue:128': [' 'presentValue'],
'analogValue:90': ['presentValue'],
'analogValue:91': ['presentValue'],
'analogValue:92': ['presentValue'],
'analogValue:94': ['presentValue'],
'analogValue:93': ['presentValue'],
'analogValue:16': ['presentValue'],
'analogValue:104': ['presentValue'],
'analogValue:105': ['presentValue'],
'binaryValue:5': ['presentValue'],
'binaryValue:40': ['presentValue'],
'analogOutput:0': ['presentValue'],
'analogOutput:1': ['presentValue'],
'binaryOutput:0': ['presentValue'],
'binaryOutput:1': ['presentValue'],
'binaryOutput:2': ['presentValue'],
}
}
result = await bacnet.readMultiple('95:5@10.10.57.12', request_dict=_rpm)
print(f'results: {result}')
Run the main function within an event loop
if name == "main":
asyncio.run(main())
Beta Was this translation helpful? Give feedback.
All reactions