Is it possible to call a VOLTTRON agent method running on an edge device via rpc from a Python web app running on a different PC on the LAN?
Sorry if this sounds like a silly question, but the raise_setpoints_up
function is what I would want to call on my VOLTTRON edge device if its even possible.
#@RPC.export
def rpc_method(self):
"""
RPC method
May be called from another agent via self.core.rpc.call
"""
def raise_setpoints_up(self):
_log.debug(f'*** [Setter Agent INFO] *** - STARTING raise_setpoints_up FUNCTION!')
Is there any documentation to read up on for this process? I am hoping to find something I can use with aiohttp with something like this below, any tips or links to read up on greatly appreciated.
import aiohttp
import asyncio
from jsonrpcclient.clients.aiohttp_client import aiohttpClient
async def main(loop):
async with aiohttp.ClientSession(loop=loop) as session:
client = aiohttpClient(session, "http://xxx.xxx.xxx.xxx:5000/") # VOLTTRON edge?
response = await client.request("agent.core.rpc.call") # agent method?
print(response.data.result)
loop = asyncio.get_event_loop()
loop.run_until_complete(main(loop))
Would it matter if the VOLTTRON edge device is single or part of a multi-platform to call an agent via rpc?