0

I have a BACnet system for HVAC controls where I am using the VOLTTRON actuator agent to write @ priority 10 in BACnet to a value of 2 which works good.

result = self.vip.rpc.call('platform.actuator', 'set_multiple_points', self.core.identity, set_multi_topic_values_master).get(timeout=20)
_log.debug(f'*** [Setter Agent INFO] *** -  set_multiple_points ON ALL VAVs WRITE SUCCESS!')

Then the system sleeps for some time period for testing purposes:

_log.debug(f'*** [Setter Agent INFO] *** -  SETTING UP GEVENT SLEEP!')
gevent.sleep(120)
_log.debug(f'*** [Setter Agent INFO] *** -  GEVENT SLEEP DONE!')

Where after the gevent sleep I am running into some issues on the revert point not working. The code below executes just fine but using a BACnet scanning tool the priority 10 value of 2 are still present on the HVAC controls, like the revert point isn't doing anything.

for device in revert_topic_devices_jci:
    response = self.vip.rpc.call('platform.actuator', 'revert_point', self.core.identity, topic_jci, self.jci_setpoint_topic).get(timeout=20)
    _log.debug(f'*** [Setter Agent INFO] *** -  REVERT POINTS ON {device} SUCCESS!')

_log.debug(f'*** [Setter Agent INFO] *** -  REVERT POINTS JCI DONE DEAL SUCCESS!')

One thing I notice is the building automation writes occupancy/unoccupancy to the HVAC controls @ BACnet priority 12. Its either ALWAYS a 1 for occupancy or a 2 for unoccupancy.

What I am trying to do with VOLTTRON is write in BACnet at priority 10 a value of 2, and then release to nothing on the revert. Could this by the revert isnt doing anything because there was nothing to revert too? I was hoping that VOLTTRON could write @ BACnet priority 10 and then just release. On BACnet scan tool I can do the same thing write @ priority 10 then release priority 10 with a priority 10 write null

Should I just be writing at priority 12 same as the building automation system so VOLTTRON can just revert back too whatever the building automation was doing?

bbartling
  • 3,288
  • 9
  • 43
  • 88

2 Answers2

0

I have a few observations:

  1. In your revert loop, the third code-block above, you're not actually changing the topic being passed to the RPC call. Each call will use the device topic which is not in that code-block (but that we can see is not being changed inside the block) and a device topic, which similarly is not defined in the block but at least appears not to be being changed. It is likely worth setting some breakpoints and/or debug statements here to be sure that you're passing the correct topics to revert on.
  2. Your use of priority appears to be consistent with BACnet protocol specification, and with the VOLTTRON BACnet driver implementation. We would not recommend that you attempt to write at the same priority as an existing building automation system.
  3. The BACnet driver code will send a NULL (None) value in a "writeProperty" service request when the "revert_point" function is called by the Platform Driver. This functionality I am frankly not terribly familiar with, but given that your scan tool performs the expected revert functionality when passed a NULL value, I suspect this is the expected way of performing a "revert to previous value" type function in BACnet protocol. I do not have reason to believe that the behavior you're experiencing is the result of a bug in the driver code base.

Overall, I suggest debugging the topics being passed in the "revert_point" RPC call.

jklarson
  • 256
  • 2
  • 2
0

I am having a good luck to revert point using set_multiple_points to None

Something like this:

        self.jci_device_map = {
        'VMA-2-6': '27',
        'VMA-2-4': '29',
        'VMA-2-7': '30',
        'VMA-1-8': '6',
}

revert_multi_topic_values_master = []
set_multi_topic_values_master = []

        for device in self.jci_device_map.values():
            topic_jci = '/'.join([self.building_topic, device])
            final_topic_jci = '/'.join([topic_jci, self.jci_setpoint_topic])

            # BACnet enum point for VAV occ
            # 1 == occ, 2 == unnoc
            
            # create a (topic, value) tuple and add it to our topic values
            set_multi_topic_values_master.append((final_topic_jci, self.unnoccupied_value)) # TO SET UNNOCUPIED
            revert_multi_topic_values_master.append((final_topic_jci, None)) # TO SET FOR REVERT

result = self.vip.rpc.call('platform.actuator', 'set_multiple_points', self.core.identity, revert_multi_topic_values_master).get(timeout=20)
bbartling
  • 3,288
  • 9
  • 43
  • 88