Mapping P1 data to a pvoutput API call

As a side project, I’m writing a Go script which reads data from my P1 “smart energy” port and sends it to pvouput. So I’m talking about my energy consumption. So, this is about two parts. The first part is about reading data from my P1 port. This is working fine, an example output is this:

INFO[0000] Version Information: 50
INFO[0000] Date timestamp: 200819201207S
INFO[0000] Equipment Identifier: 4530303434303036383631373736343137
INFO[0000] Electricity delivered to client (tariff 1): 003999.014 kWh
INFO[0000] Electricity delivered to client (tariff 2): 004928.391 kWh
INFO[0000] Electricity generated by client (tariff 1): 000272.167 kWh
INFO[0000] Electricity generated by client (tariff 2): 000695.112 kWh
INFO[0000] Electricity tariff indicator: 0002
INFO[0000] Actual electricity delivered: 00.232 kW
INFO[0000] Actual electricity generated: 00.000 kW
INFO[0000] Number of power failures on any phase: 00004
INFO[0000] Number of long power failures on any phase: 00004
INFO[0000] Event log for long power failures: 0000005667 s
INFO[0000] Number of voltage sags on phase L1: 00002
INFO[0000] Number of voltage sags on phase L2: 00004
INFO[0000] Number of voltage sags on phase L3: 00003
INFO[0000] Number of voltage swells on phase L1: 00001
INFO[0000] Number of voltage swells on phase L2: 00001
INFO[0000] Number of voltage swells on phase L3: 00001
INFO[0000] Instantaneous voltage on phase L1: 229.3 V
INFO[0000] Instantaneous voltage on phase L2: 229.4 V
INFO[0000] Instantaneous voltage on phase L3: 229.1 V
INFO[0000] Instantaneous current on phase L1: 000 A
INFO[0000] Instantaneous current on phase L2: 000 A
INFO[0000] Instantaneous current on phase L3: 000 A
INFO[0000] Instantaneous active power delivered on phase L1: 00.098 kW
INFO[0000] Instantaneous active power delivered on phase L2: 00.155 kW
INFO[0000] Instantaneous active power delivered on phase L3: 00.000 kW
INFO[0000] Instantaneous active power generated on phase L1: 00.000 kW
INFO[0000] Instantaneous active power generated on phase L2: 00.000 kW
INFO[0000] Instantaneous active power generated on phase L3: 00.023 kW

Now the next part is to send this data to pvoutput using the API. Now my questions:

  • given the above output, what is the best pvoutput API endpoint to use?
  • how can I “map” the P1 output data into a decent and correct call to send the data to pvoutput? I’m having a hard time finding the correct mappings between the P1 output and the data needed in the POST to pvoutput API.

Use Add Status API for 5-minute updates -

1 Like

Ok, that’s clear. But the first part is about getting the data out of my P1 port. Please see my first post, what value should I pick which is suitable to send as "last 5 min value for either v3 or v4 input for pvoutput?

  • v1 = gross energy generation (Wh)
  • v2 = gross power generation (W)
  • v3 = gross energy consumption (Wh)
  • v4 = gross power generation (W)

Assuming readouts above are gross not net.

v2 = L1 + L2 + L3 = 0 + 0 + 23 = 23W
v4 = L1 + L2 + L3 = 98 + 155 + 0 = 252W

v1 and v3 is calculated from v2 and v2 respectively or these can be sent to override.