Code-House / bacnet4j-wrapper

Simple facade for bacnet4j api.
GNU General Public License v3.0
48 stars 20 forks source link

ReadOnly property for BACnetObject #29

Closed saransh14 closed 10 months ago

saransh14 commented 10 months ago

Is there any way to identify if the object/data point is only read enabled or read-write enabled. I'm unable to find any parameter value in BACnet Object to judge if the point is only read enabled or read-write enabled.

saransh14 commented 10 months ago

Hi @splatch, how can I get the list of all the properties of the object, I'm trying to use the getObjectPropertyNames method present under the api package, to get the list of all the properties defined for the specific object type. But I'm getting the APDUException for it.

image

Here is the wireshark snapshot for the same request

image
saransh14 commented 10 months ago

I even tried the DiscoveryMain class to generate the dump for the object property names, but the same exception occured which fetching the details for the Bacnet.Room.Simulator present under Yabe.

splatch commented 10 months ago

There is no clear way to know which object properties are writeable and which are not. Overall - you can try to come with sensible defaults from object type (i.e. Analog Input vs Analog Output) and whether they are command or not.

You can assume that following objects are mutable:

analogOutput
analogValue
binaryOutput
binaryValue
multiStateOutput
multiStateValue
accessDoor
characterstringValue
datetimeValue
largeAnalogValue
bitstringValue
octetstringValue
timeValue
integerValue
positiveIntegerValue
dateValue
datetimePatternValue
timePatternValue
datePatternValue
lightingOutput
binaryLightingOutput

Some of mutability flags could be probably read from/through vendor specific objects which may consist extra information.

With regard to error message - it is not clear to me why it fails. Error message indicates only that device can't answer the call. Since requested property (property-list) comes from standard I'd ask manufacturer of it for conformance statement or technical documentation which lists properties. It could also be that device improperly implements segmentation and can't send answer exceeding certain size, yet if you see object list (which often might trigger segmentation), you should also see property list.

saransh14 commented 10 months ago

I'm trying to fetch the property-list for the AddOn for Room Simulator available under YABE. Can you please confirm if you're able to fetch the property list for those, I'm just able to generate the dump from DiscoveryMain as follows:

  => Device id 2277423 (IpDevice)
     Metadata
       Address: 192.168.1.7:40021
       Name: RoomController.Simulator
       Model: Room_FC_2014
       Vendor: 
          => Type ANALOG_INPUT id: 0
             Metadata
               Name: Temperature.Indoor
               Units: degrees-celsius
               Description: Indoor Temperature
             Present value 20.8, type: com.serotonin.bacnet4j.type.primitive.Real
      => Error: Could not get property value
          => Type ANALOG_INPUT id: 1
             Metadata
               Name: Temperature.Water
               Units: degrees-celsius
               Description: Glycol Water Temperature
             Present value 39.2, type: com.serotonin.bacnet4j.type.primitive.Real
      => Error: Could not get property value
          => Type ANALOG_INPUT id: 2
             Metadata
               Name: Temperature.Outdoor
               Units: degrees-celsius
               Description: Outdoor Temperature
             Present value 12.0, type: com.serotonin.bacnet4j.type.primitive.Real
      => Error: Could not get property value
          => Type ANALOG_VALUE id: 0
             Metadata
               Name: SetPoint.Value
               Units: degrees-celsius
               Description: Effective SetPoint
             Present value 21.0, type: com.serotonin.bacnet4j.type.primitive.Real
      => Error: Could not get property value
          => Type ANALOG_VALUE id: 1
             Metadata
               Name: Setpoint.1
               Units: degrees-celsius
               Description: Setoint 1
             Present value 21.0, type: com.serotonin.bacnet4j.type.primitive.Real
      => Error: Could not get property value
          => Type ANALOG_VALUE id: 2
             Metadata
               Name: Setpoint.2
               Units: degrees-celsius
               Description: Setpoint 2
             Present value 19.0, type: com.serotonin.bacnet4j.type.primitive.Real
      => Error: Could not get property value
          => Type ANALOG_VALUE id: 3
             Metadata
               Name: Setpoint.3
               Units: degrees-celsius
               Description: Setpoint 3
             Present value 17.0, type: com.serotonin.bacnet4j.type.primitive.Real
      => Error: Could not get property value
          => Type CHARACTER_STRING id: 1
             Metadata
               Name: TextSetpoint.1
               Units: null
               Description: Text for Setpoint 1
             Present value Comfort, type: com.serotonin.bacnet4j.type.primitive.CharacterString
      => Error: Could not get property value
          => Type CHARACTER_STRING id: 2
             Metadata
               Name: TextSetpoint.2
               Units: null
               Description: Text for Setpoint 2
             Present value Eco+, type: com.serotonin.bacnet4j.type.primitive.CharacterString
      => Error: Could not get property value
          => Type CHARACTER_STRING id: 3
             Metadata
               Name: TextSetpoint.3
               Units: null
               Description: Text for Setpoint 3
             Present value Vacancy, type: com.serotonin.bacnet4j.type.primitive.CharacterString
      => Error: Could not get property value
          => Type BINARY_VALUE id: 0
             Metadata
               Name: State.Heater
               Units: null
               Description: Heater Status
      => Error: Could not get property value
          => Type BINARY_VALUE id: 1
             Metadata
               Name: State.Chiller
               Units: null
               Description: Chiller Status
             Present value inactive, type: com.serotonin.bacnet4j.type.enumerated.BinaryPV
      => Error: Could not get property value
          => Type MULTISTATE_VALUE id: 0
             Metadata
               Name: State
               Units: null
               Description: Controler State Command
             Present value 2, type: com.serotonin.bacnet4j.type.primitive.UnsignedInteger
      => Error: Could not get property value
          => Type MULTISTATE_VALUE id: 1
             Metadata
               Name: State.VentilationLevel
               Units: null
               Description: Ventilation level
             Present value 2, type: com.serotonin.bacnet4j.type.primitive.UnsignedInteger
      => Error: Could not get property value
Discovery complete
splatch commented 10 months ago

It took me a moment, but I got simulator output 0 without attributes. Apparently simulator does not implement that functionality.

  => Device id 1294418 (IpDevice)
     Metadata
       Address: 10.10.10.218:64169
       Name: RoomController.Simulator
       Model: Room_FC_2014
       Vendor: 
          => Type ANALOG_INPUT id: 0
             Metadata
               Name: Temperature.Indoor
               Units: degrees-fahrenheit
               Description: Indoor Temperature
             Present value 69.8, type: com.serotonin.bacnet4j.type.primitive.Real
          => Type ANALOG_INPUT id: 1
             Metadata
               Name: Temperature.Water
               Units: degrees-fahrenheit
               Description: Glycol Water Temperature
             Present value 93.5, type: com.serotonin.bacnet4j.type.primitive.Real
          => Type ANALOG_INPUT id: 2
             Metadata
               Name: Temperature.Outdoor
               Units: degrees-fahrenheit
               Description: Outdoor Temperature
             Present value 53.6, type: com.serotonin.bacnet4j.type.primitive.Real
          => Type ANALOG_VALUE id: 0
             Metadata
               Name: SetPoint.Value
               Units: degrees-fahrenheit
               Description: Effective SetPoint
             Present value 70.0, type: com.serotonin.bacnet4j.type.primitive.Real
          => Type ANALOG_VALUE id: 1
             Metadata
               Name: Setpoint.1
               Units: degrees-fahrenheit
               Description: Setoint 1
             Present value 70.0, type: com.serotonin.bacnet4j.type.primitive.Real
          => Type ANALOG_VALUE id: 2
             Metadata
               Name: Setpoint.2
               Units: degrees-fahrenheit
               Description: Setpoint 2
             Present value 66.0, type: com.serotonin.bacnet4j.type.primitive.Real
          => Type ANALOG_VALUE id: 3
             Metadata
               Name: Setpoint.3
               Units: degrees-fahrenheit
               Description: Setpoint 3
             Present value 63.0, type: com.serotonin.bacnet4j.type.primitive.Real
          => Type CHARACTER_STRING id: 1
             Metadata
               Name: TextSetpoint.1
               Units: null
               Description: Text for Setpoint 1
             Present value Comfort, type: com.serotonin.bacnet4j.type.primitive.CharacterString
          => Type CHARACTER_STRING id: 2
             Metadata
               Name: TextSetpoint.2
               Units: null
               Description: Text for Setpoint 2
             Present value Eco+, type: com.serotonin.bacnet4j.type.primitive.CharacterString
          => Type CHARACTER_STRING id: 3
             Metadata
               Name: TextSetpoint.3
               Units: null
               Description: Text for Setpoint 3
             Present value Vacancy, type: com.serotonin.bacnet4j.type.primitive.CharacterString
          => Type BINARY_VALUE id: 0
             Metadata
               Name: State.Heater
               Units: null
               Description: Heater Status
          => Type BINARY_VALUE id: 1
             Metadata
               Name: State.Chiller
               Units: null
               Description: Chiller Status
             Present value inactive, type: com.serotonin.bacnet4j.type.enumerated.BinaryPV
          => Type MULTISTATE_VALUE id: 0
             Metadata
               Name: State
               Units: null
               Description: Controler State Command
             Present value 2, type: com.serotonin.bacnet4j.type.primitive.UnsignedInteger
          => Type MULTISTATE_VALUE id: 1
             Metadata
               Name: State.VentilationLevel
               Units: null
               Description: Ventilation level
             Present value 2, type: com.serotonin.bacnet4j.type.primitive.UnsignedInteger
saransh14 commented 10 months ago

Thanks @splatch for the confirmation. Do you have any recommendations for any other bacnet device simulator, or any link reference for coded bacnetIP server?

splatch commented 10 months ago

I've used some commercial trial which expired too soon, so I use some code samples from bacnet4j itself (the underlying library) to run test devices through simple Java mains. These are sufficient to complete most of tests. Other tests I conduct with basic digital input/output device from metz - it has two switchable outputs.

saransh14 commented 10 months ago

Ok thanks @splatch.