oadrUpdateReport.xml 2.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. <oadr:oadrSignedObject xmlns:oadr="http://openadr.org/oadr-2.0b/2012/07" xmlns:pyld="http://docs.oasis-open.org/ns/energyinterop/201110/payloads" xmlns:emix="http://docs.oasis-open.org/ns/emix/2011/06" oadr:Id="oadrSignedObject">
  2. <oadr:oadrUpdateReport ei:schemaVersion="2.0b" xmlns:ei="http://docs.oasis-open.org/ns/energyinterop/201110">
  3. <pyld:requestID>{{ request_id }}</pyld:requestID>
  4. {% if reports %}
  5. {% for report in reports %}
  6. <oadr:oadrReport xmlns:xcal="urn:ietf:params:xml:ns:icalendar-2.0">
  7. {% if report.dtstart is defined and report.dtstart is not none %}
  8. <xcal:dtstart>
  9. <xcal:date-time>{{ report.dtstart|datetimeformat }}</xcal:date-time>
  10. </xcal:dtstart>
  11. {% endif %}
  12. {% if report.intervals %}
  13. <strm:intervals xmlns:strm="urn:ietf:params:xml:ns:icalendar-2.0:stream">
  14. {% for interval in report.intervals %}
  15. <ei:interval>
  16. <xcal:dtstart>
  17. <xcal:date-time>{{ interval.dtstart|datetimeformat }}</xcal:date-time>
  18. </xcal:dtstart>
  19. <oadr:oadrReportPayload>
  20. <ei:rID>{{ interval.report_payload.r_id }}</ei:rID>
  21. {% if interval.report_payload.confidence is defined and interval.report_payload.confidence is not none %}
  22. <ei:confidence>{{ interval.report_payload.confidence }}</ei:confidence>
  23. {% endif %}
  24. {% if interval.report_payload.accuracy is defined and interval.report_payload.accuracy is not none %}
  25. <ei:accuracy>{{ interval.report_payload.accuracy }}</ei:accuracy>
  26. {% endif %}
  27. <ei:payloadFloat>
  28. <ei:value>{{ interval.report_payload.value }}</ei:value>
  29. </ei:payloadFloat>
  30. {% if interval.report_payload.data_quality is defined and interval.report_payload.data_quality is not none %}
  31. <oadr:oadrDataQuality>{{ interval.report_payload.data_quality }}</oadr:oadrDataQuality>
  32. {% endif %}
  33. </oadr:oadrReportPayload>
  34. </ei:interval>
  35. {% endfor %}
  36. </strm:intervals>
  37. {% endif %}
  38. <ei:eiReportID>{{ report.report_id }}</ei:eiReportID>
  39. {% if report.report_descriptions %}
  40. {% for report_description in report.report_descriptions %}
  41. {% include 'parts/oadrReportDescription.xml' %}
  42. {% endfor %}
  43. {% endif %}
  44. <ei:reportRequestID>{{ report.report_request_id }}</ei:reportRequestID>
  45. <ei:reportSpecifierID>{{ report.report_specifier_id }}</ei:reportSpecifierID>
  46. {% if report.report_name %}
  47. <ei:reportName>{{ report.report_name }}</ei:reportName>
  48. {% endif %}
  49. <ei:createdDateTime>{{ report.created_date_time|datetimeformat }}</ei:createdDateTime>
  50. </oadr:oadrReport>
  51. {% endfor %}
  52. {% endif %}
  53. {% if ven_id is defined and ven_id is not none %}
  54. <ei:venID>{{ ven_id }}</ei:venID>
  55. {% endif %}
  56. </oadr:oadrUpdateReport>
  57. </oadr:oadrSignedObject>