Search code examples
pythonvolttron

VOLTTRON set_point


I am trying to use the actuator agent to write to a building automation point with set_point. This is the a snip from my Python code:

    _log.info(f'{log_prefix} - meter_topic: {meter_topic}')
    _log.info(f'{log_prefix} - self.electric_meter_value: {self.electric_meter_value}')

    self.vip.rpc.call('platform.actuator',
                    'set_point', 
                    self.core.identity, 
                    meter_topic,
                    self.electric_meter_value
                    ).get(timeout=300) 

This is the traceback in my volttron.log file:

2023-09-28 20:10:26,482 (rtuloadshedagent-0.1 49669) __main__ INFO: [WRITE POWER METER VAL INFO] - meter_topic: 500001/input-power-meter
2023-09-28 20:10:26,482 (rtuloadshedagent-0.1 49669) __main__ INFO: [WRITE POWER METER VAL INFO] - self.electric_meter_value: 0
2023-09-28 20:10:26,484 (platform_driveragent-4.0 49556) volttron.platform.vip.agent.subsystems.rpc ERROR: unhandled exception in JSON-RPC method 'set_point':
Traceback (most recent call last):
  File "/home/geb/volttron/volttron/platform/vip/agent/subsystems/rpc.py", line 181, in method
    return method(*args, **kwargs)
  File "/home/geb/.volttron/agents/21d572a4-52ef-4e75-b603-f5d56bfc9951/platform_driveragent-4.0/platform_driver/agent.py", line 468, in set_point
    return self.instances[path].set_point(point_name, value, **kwargs)
KeyError: '500001'

This is how the points are defined in VOLTTRON but unsure why I get the error? Unless its looking for this longer full string devices/slipstream_internal/slipstream_hq/500001. Any troubleshooting tips appreciated.

vctl config store platform.driver registry_configs/500001.csv registry_configs/500001.csv --csv 

vctl config store platform.driver devices/slipstream_internal/slipstream_hq/500001 devices/500001

Solution

  • You are correct, so it is looking for "slipstream_internal/slipstream_hq/500001".

    vctl config store <vip-id> <config_name> <config_file>

    It is interesting, as you must have a file at ./devices/500001 or the vctl store command would have produced an error.