This release is a pre-release and may not be stable for production use.
OpenADRVen Agent
OpenADR (Automated Demand Response) is a standard for alerting and responding to the need to adjust electric power consumption in response to fluctuations in grid demand.
Prerequisites
- Python 3.8
Installation
-
Create and activate a virtual environment.
python -m venv env source env/bin/activate
-
Install volttron and start the platform.
pip install volttron # Start platform with output going to volttron.log volttron -vv -l volttron.log &
-
Install and start the Volttron OpenADRVen Agent.
vctl install volttron-openadr-ven --agent-config <path to agent config> \ --vip-identity openadr.ven \ --start
-
View the status of the installed agent
vctl status -
Observe Data
The OpenADR publishes events on the message bus. To see these events in the Volttron log file, install a Listener Agent:
vctl install volttron-listener --startOnce installed, you should see the data being published by viewing the Volttron logs file that was created in step 2.
To watch the logs, open a separate terminal and run the following command:
tail -f <path to folder containing volttron.log>/volttron.log
Agent Configuration
The required parameters for this agent are "ven_name" and "vtn_url". Below is an example of a correct configuration with optional parameters added.
{
"ven_name": "PNNLVEN",
"vtn_url": "https://eiss2demo.ipkeys.com/oadr2/OpenADR2/Simple/2.0b",
"cert_path": "~/.ssh/secret/TEST_RSA_VEN_210923215148_cert.pem",
"key_path": "~/.ssh/secret/TEST_RSA_VEN_210923215148_privkey.pem",
"debug": true,
"disable_signature": true
}
Save this configuration in a JSON file in your preferred location. An example of such a configuration is saved in the
root of this repository; the file is named config_example1.json
Testing
If you don't have a dedicated VTN to test the VolttronOpenADR against, you can setup a local VTN instead. This VTN will be hosted at localhost on port 8080 (i.e. 127.0.0.1:8080). This VTN will accept registrations from a VEN named 'ven123', requests all reports that the VEN offers, and create an Event for the VEN. After setting up a local VTN, configure an VolttronOpenADRVen Agent against that local VTN and then install the agent on your VOLTTRON instance. Ensure that the VOLTTRON instance is running on the same host that the VTN is running on.
To setup a local VTN, we have provided a script and a custom agent configuration for convenience. Follow the steps below to setup a local VTN and corresponding Volttron OpenADRVen Agent:
Setup VTN
Setup a dedicated environment for the VTN.
-
Clone this repo.
-
Create a dedicated virtual environment for the VTN:
python -m venv env source env/bin/activate
-
Install openleadr:
pip install openleadr
-
At the top level of this repo, run the VTN server in the foreground so that we can observe logs:
python utils/vtn.pyThis VTN uses port 8080 by default. If you want to use a custom port, set the environment variable "VTN_PORT" to your desired port and start the VTN. For example:
VTN_PORT=8081 python utils/vtn.py
After you start the VTN, you should see the following logs:
If you provide a 'ven_lookup' to your OpenADRServer() init, OpenLEADR can automatically issue ReregistrationRequests for VENs that don't exist in your system. Please see https://openleadr.org/docs/server.html#things-you-should-implement. ************************************************************************ Your VTN Server is now running at http://127.0.0.1:8080/OpenADR2/Simple/2.0b ************************************************************************
Setup VolttronOpenADR Ven
Setup a dedicated environment for the Volttron platform and VolttronOpenADRVen Agent.
-
Open up another terminal, create a folder called temp, and create another virtual environment:
mkdir temp cd temp python -m venv env source env/bin/activate
-
Install volttron:
pip install volttron
-
Run volttron in the background:
volttron -vv -l volttron.log &
-
Install the VolttronOpenADRVEN Agent using the configuration provided under
utils:vctl install volttron-openadr-ven --agent-config utils/config_toy_ven.json --tag openadr --start
-
Observe the logs to verify that the Event from the local VTN was received by the VolttronOpenADRVEN agent. The topic follows this format "openadr/event/<event_id>/".
tail -f volttron.log
You should expect to see the following in the logs:
2023-01-12 12:01:36,222 (volttron-listener-0.2.0rc0 31258) listener.agent(104) INFO: Peer: pubsub, Sender: volttron-openadr-ven-1.0.1a1_1:, Bus: , Topic: openadr/event/2ab3526f-235b-4c66-8b31-e04a95406913/ven123, Headers: {'TimeStamp': '2023-01-12T20:01:36.215472+00:00', 'min_compatible_version': '3.0', 'max_compatible_version': '' }, Message: {'active_period': {'dtstart': '2023-01-12T20:05:47.204310+00:00', 'duration': 3600}, 'event_descriptor': {'created_date_time': '2023-01-12T20:00:47.204940+00:00', 'event_id': '2ab3526f-235b-4c66-8b31-e04a95406913', 'event_status': 'far', 'market_context': 'oadr://unknown.context', 'modification_date_time': '2023-01-12T20:00:47.204950+00:00', 'modification_number': 0, 'priority': 0, 'test_event': False}, 'event_signals': [{'intervals': [{'dtstart': '2023-01-12T20:05:47.204310+00:00', 'duration': 3600, 'signal_payload': 100.0, 'uid': 0}], 'signal_id': '9e3cda6b-9d09-4f5a-99e5-00b41e480d2f', 'signal_name': 'simple', 'signal_type': 'level'}], 'response_required': 'always', 'targets': [{'ven_id': 'ven_id_123'}], 'targets_by_type': {'ven_id': ['ven_id_123']}}
Development
Please see the following for contributing guidelines contributing.
Please see the following helpful guide about developing modular VOLTTRON agents
Disclaimer Notice
This material was prepared as an account of work sponsored by an agency of the United States Government. Neither the United States Government nor the United States Department of Energy, nor Battelle, nor any of their employees, nor any jurisdiction or organization that has cooperated in the development of these materials, makes any warranty, express or implied, or assumes any legal liability or responsibility for the accuracy, completeness, or usefulness or any information, apparatus, product, software, or process disclosed, or represents that its use would not infringe privately owned rights.
Reference herein to any specific commercial product, process, or service by trade name, trademark, manufacturer, or otherwise does not necessarily constitute or imply its endorsement, recommendation, or favoring by the United States Government or any agency thereof, or Battelle Memorial Institute. The views and opinions of authors expressed herein do not necessarily state or reflect those of the United States Government or any agency thereof.
Metadata
Release files for volttron-openadr-ven 1.0.2rc1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| volttron_openadr_ven-1.0.2rc1.tar.gz | 17.2 kB | Without provenance | Details for volttron_openadr_ven-1.0.2rc1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| volttron_openadr_ven-1.0.2rc1-py3-none-any.whl | Python 3 | none | any | Details for volttron_openadr_ven-1.0.2rc1-py3-none-any.whl |
Total release size: 33.6 kB
Release files / volttron_openadr_ven-1.0.2rc1.tar.gz
| Download URL | volttron_openadr_ven-1.0.2rc1.tar.gz |
|---|---|
| Size | 17.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
568ac86fabfdd39b11106d0d10c7b1662a78c941fe6e5c3bc599ccdcaf191446
|
|
BLAKE2b-256 checksum How to use checksums |
c6964952237fa1bcf493af99dc4744b17b16f817bbd0264953d9011282d471f7
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.2.2 CPython/3.8.16 Linux/5.15.0-1031-azure
|
Release files / volttron_openadr_ven-1.0.2rc1-py3-none-any.whl
| Download URL | volttron_openadr_ven-1.0.2rc1-py3-none-any.whl |
|---|---|
| Size | 16.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
228b1c113319aa1aa59268860c1c5ade94314e045822840a08edda9dab75114e
|
|
BLAKE2b-256 checksum How to use checksums |
65dc6243e1fcb08ae919836c0054a2fe059ee2fc838921997aa3d03d35ad3bca
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.2.2 CPython/3.8.16 Linux/5.15.0-1031-azure
|
Security for volttron-openadr-ven 1.0.2rc1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.