-
Notifications
You must be signed in to change notification settings - Fork 51
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How the DSRSP(the VTN) handles the oadrPoll request? #161
Comments
Thank you a lot in advance! For any kinds of instruction! |
In OpenLEADR, the following is supported. If you use the default internal polling handler, the following is supported:
If you want to deliver the other messages, you can disable the internal polling mechanism, and implement your own # vtn.py
from openleadr import OpenADRServer
def my_custom_polling_handler(ven_id):
"""
Called when the ven with 'ven_id' does a Poll
"""
# You should determine what message you want to send to the client here. For example, look it up in a database or some dictionary or datastore that you have.
# For example:
message_type = "oadrRequestReregistration"
message_payload = {'ven_id': ven_id}
# Or, to create a report:
message_type = "oadrCreateReport"
message_payload = {
"request_id": "request123",
"report_requests": [
{
"report_request_id": "reportrequest123",
"report_specifier": {
"report_specifier_id": "reportspec123",
"granularity": timedelta(minutes=15),
"specifier_payloads": [
{"r_id": "rid123", "reading_type": "Direct Read"}
]
}
]
}
return message_type, message_payload
# Create a new server and set the polling method to external
server = OpenADRServer(...,)
# Add our own polling handler. This should return the correct message for the VEN.
server.add_handler('on_poll', my_custom_polling_handler) You'll be 'on your own' to handle the responses to these, but it is absolutely supported. Let me know if this helps! |
In the source code, we could see that the VTN responds to an oadrPoll payload with oadrDistributeEvent or oadrResponse. This is in <<poll_service.py>>.
However, on the client(the VEN) side, the expected responses of a poll action may be one of the following: oadrResponse, oadrRequestReregistration, oadrDistributeEvent, oadrUpdateReport, oadrCreateReport, etc, etc. How could we initiate all these payloads from the VTN side? It looks like it isn't implemented at all in OpenleADR?
The text was updated successfully, but these errors were encountered: