BAC0 icon indicating copy to clipboard operation
BAC0 copied to clipboard

problems with writeFunction on binaries Inputs

Open Sekiro-kost opened this issue 2 years ago • 5 comments

Hello Christian

I have a problem with writing values to binary inputs

In my code, I have this :

   value = 'inactive'
  eqnetwork = '192..........'
  object_type = 'multiStateValue'
  object_instance = 27560
  priority = 8

  write_vals = f'{eqnetwork} {object_type} {object_instance} presentValue {value} - {priority}'         
 bacnet.write(write_vals)

I have an invalid literal for int() with base 10 'inactive' error

However, if I try to put 0 instead of inactive, I get an outOfRange error, and if I try to put false, I also get a base 10 error

However, I thought it worked with active or inactive values on binaries.

Do you have any idea of the problem here?

Sekiro-kost avatar Jun 22 '22 10:06 Sekiro-kost

Normally, Binary Inputs are read only. Writable if out_of_service is true.

ChristianTremblay avatar Jun 22 '22 10:06 ChristianTremblay

Thx for your reply.

What do you mean by : Writable if out_of_service is true ?

Sekiro-kost avatar Jun 22 '22 10:06 Sekiro-kost

BACnet objects can have a property (like present_value is a property of an object).

If someone write true to the property out_of_service, if implemented, it will disconnect the binaryInput from the hardware and you can then modify the presentValue by writing to it.

But it is not a common way to operate and it is meant for troubleshooting and testing cases.

ChristianTremblay avatar Jun 22 '22 11:06 ChristianTremblay

Hmm oki, thanks

Last question: for MultiStateValue, what is the property to access the different values available?

Is it statusFlags?

Sincerely

Sekiro-kost avatar Jun 22 '22 11:06 Sekiro-kost

in BACnet it's the state_text property in a BAC-.device, look for device.properties.units_state

ChristianTremblay avatar Jun 23 '22 18:06 ChristianTremblay

This issue had no activity for a long period of time. If this issue is still required, please update the status or else, it will be closed. Please note that an issue can be reopened if required.

github-actions[bot] avatar Aug 23 '22 03:08 github-actions[bot]