JoelBender / bacpypes

BACpypes provides a BACnet application layer and network layer written in Python for daemons, scripting, and graphical interfaces.
MIT License
303 stars 129 forks source link

Writing BACnet property #349

Closed barrashi closed 4 years ago

barrashi commented 4 years ago

Hi

I assume i am the problem, but i am just missing here something

I am attempting to write a value to a BACnet device at ip 192.168.4.4 with id 2000002 analogValue 2 and change the presentValue to 0

all of the examples of WRITE have """write [ ]"""

how do i translate the above to the correct console write command?

i am fine reading the above using

rpm 2000002 analogValue:2 presentValue

Thank you.

JoelBender commented 4 years ago

The ReadWriteProperty.py sample application has both read and write commands, and the write is very similar to the read. The first parameter is the address, then the object identifier, property name, and a value.

write 192.168.4.4 analogValue:2 presentValue 75.3

There are a few different ways to convert the string "75.3" into a primitive value, and with this simple application there is no way to write "sequences" or "choices" (the ASN names for things like C-style structures and unions). Use the force, read the source!