mirror of
https://github.com/lumapu/ahoy.git
synced 2025-07-13 22:47:15 +02:00
RPi-calculate and print irradiation (Bestrahlung)
To calculate irradiation, max-power of each PV module must be defined in ahoy.yml (pls see ahoy.yml.example)
This commit is contained in:
parent
a09b9c25ba
commit
17c1fec2ad
3 changed files with 83 additions and 13 deletions
|
@ -115,14 +115,18 @@ class InfluxOutputPlugin(OutputPluginFactory):
|
|||
data_stack.append(f'{measurement},string={string_id},type=power value={string["power"]:.2f} {ctime}')
|
||||
data_stack.append(f'{measurement},string={string_id},type=YieldDay value={string["energy_daily"]:.2f} {ctime}')
|
||||
data_stack.append(f'{measurement},string={string_id},type=YieldTotal value={string["energy_total"]/1000:.4f} {ctime}')
|
||||
if 'irradiation' in string:
|
||||
data_stack.append(f'{measurement},string={string_id},type=Irradiation value={string["irradiation"]:.2f} {ctime}')
|
||||
string_id = string_id + 1
|
||||
|
||||
# Global
|
||||
if data['event_count'] is not None:
|
||||
data_stack.append(f'{measurement},type=total_events value={data["event_count"]} {ctime}')
|
||||
if data['powerfactor'] is not None:
|
||||
data_stack.append(f'{measurement},type=pf value={data["powerfactor"]:f} {ctime}')
|
||||
data_stack.append(f'{measurement},type=frequency value={data["frequency"]:.3f} {ctime}')
|
||||
data_stack.append(f'{measurement},type=temperature value={data["temperature"]:.2f} {ctime}')
|
||||
|
||||
data_stack.append(f'{measurement},type=Temp value={data["temperature"]:.2f} {ctime}')
|
||||
if data['energy_total'] is not None:
|
||||
data_stack.append(f'{measurement},type=total value={data["energy_total"]/1000:.3f} {ctime}')
|
||||
|
||||
|
@ -205,15 +209,19 @@ class MqttOutputPlugin(OutputPluginFactory):
|
|||
for string in data['strings']:
|
||||
self.client.publish(f'{topic}/emeter-dc/{string_id}/voltage', string['voltage'])
|
||||
self.client.publish(f'{topic}/emeter-dc/{string_id}/current', string['current'])
|
||||
self.client.publish(f'{topic}/emeter-dc/{string_id}/power', string['power'])
|
||||
self.client.publish(f'{topic}/emeter-dc/{string_id}/YieldDay', string['energy_daily'])
|
||||
self.client.publish(f'{topic}/emeter-dc/{string_id}/YieldTotal', string['energy_total']/1000)
|
||||
if 'irradiation' in string:
|
||||
self.client.publish(f'{topic}/emeter-dc/{string_id}/Irradiation', string['irradiation'])
|
||||
string_id = string_id + 1
|
||||
|
||||
# Global
|
||||
if data['powerfactor'] is not None:
|
||||
self.client.publish(f'{topic}/pf', data['powerfactor'])
|
||||
self.client.publish(f'{topic}/frequency', data['frequency'])
|
||||
self.client.publish(f'{topic}/temperature', data['temperature'])
|
||||
|
||||
self.client.publish(f'{topic}/Temp', data['temperature'])
|
||||
if data['energy_total'] is not None:
|
||||
self.client.publish(f'{topic}/total', data['energy_total']/1000)
|
||||
|
||||
|
@ -265,13 +273,16 @@ class VzInverterOutput:
|
|||
self.try_publish(ts, f'dc_power{string_id}', string['power'])
|
||||
self.try_publish(ts, f'dc_YieldDay{string_id}', string['energy_daily'])
|
||||
self.try_publish(ts, f'dc_YieldTotal{string_id}', string['energy_total'])
|
||||
if 'irradiation' in string:
|
||||
self.try_publish(ts, f'dc_Irradiation{string_id}', string['irradiation'])
|
||||
string_id = string_id + 1
|
||||
|
||||
# Global
|
||||
if data['powerfactor'] is not None:
|
||||
self.try_publish(ts, f'powerfactor', data['powerfactor'])
|
||||
self.try_publish(ts, f'frequency', data['frequency'])
|
||||
self.try_publish(ts, f'temperature', data['temperature'])
|
||||
|
||||
self.try_publish(ts, f'Temp', data['temperature'])
|
||||
if data['energy_total'] is not None:
|
||||
self.try_publish(ts, f'total', data['energy_total'])
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue