diff --git a/SunGather/config-example.yaml b/SunGather/config-example.yaml index a3e1664..2f39a2e 100644 --- a/SunGather/config-example.yaml +++ b/SunGather/config-example.yaml @@ -132,12 +132,12 @@ exports: # register: - name: v4 # Power Consumption register: load_power # Current Home usage (Power) - - name: v5 # Temperature - register: internal_temperature # Inverter internal temperature +# - name: v5 # Ambient temperature see: https://forum.pvoutput.org/t/what-temperature-is-used-to-calculate-insolation/2106 +# register: internal_temperature # - name: v6 # Voltage register: phase_a_voltage # Read voltage from first Phase - name: c1 # Cumulative Flag, - value: 2 # If using v2/v4 set to 1 + value: 2 # If using v2 & v4 set to 1, of using only v1 set to 2 (if daily totals) # - name: "n" # Net Flag # value: 1 # - name: "v7" # Extended Value v7 - Donation Only diff --git a/SunGather/exports/pvoutput.py b/SunGather/exports/pvoutput.py index d8b0093..78eb009 100644 --- a/SunGather/exports/pvoutput.py +++ b/SunGather/exports/pvoutput.py @@ -101,7 +101,10 @@ def publish(self, inverter): if int(now.strftime("%M")) % self.status_interval == 0 and not now.strftime("%H:%M") == self.latest_run.strftime("%H:%M"): for v in self.collected_data: if v[0] == 'v' and not self.collected_data[v] == 0: - self.collected_data[v] = round(self.collected_data[v] / self.collected_data['count'], 2) + if v[1] == '6' or v[1] == '7': # Round to 1 decimal place + self.collected_data[v] = round(self.collected_data[v] / self.collected_data['count'], 1) + else: # Getting errors when uploading decimals for power/energy so return INT + self.collected_data[v] = int(self.collected_data[v] / self.collected_data['count']) data_point = str(now.strftime("%Y%m%d")) + "," + str(now.strftime("%H:%M")) @@ -111,16 +114,9 @@ def publish(self, inverter): data_point = data_point + "," + str(self.collected_data[v]) else: data_point = data_point + "," - - if self.collected_data.get('v2', False) and self.collected_data.get('v4', False): - net_data = 1 - else: - net_data = 0 self.collected_data = {} - print(data_point) - if self.payload_data: self.payload_data = self.payload_data + ";" else: @@ -128,14 +124,12 @@ def publish(self, inverter): self.payload_data = self.payload_data + data_point self.batch_count +=1 - + if self.batch_count == self.batch_points: payload = {} payload['data'] = self.payload_data - if net_data > 0: - payload['n'] = net_data if 'cumulative_energy' in locals(): payload['c1'] = cumulative_energy diff --git a/SunGather/registers.yaml b/SunGather/registers.yaml index 0592dd5..f31af50 100644 --- a/SunGather/registers.yaml +++ b/SunGather/registers.yaml @@ -209,7 +209,6 @@ registers: address: 5008 datatype: "S16" multiple: 0.1 - zero_on_standby: True - name: "total_apparent_power" level: 1 address: 5009 @@ -258,7 +257,6 @@ registers: address: 5019 datatype: "U16" multiple: 0.1 - zero_on_standby: True - name: "phase_b_voltage" level: 2 address: 5020 diff --git a/SunGather/sungather.py b/SunGather/sungather.py index f6273f6..ea91c1b 100644 --- a/SunGather/sungather.py +++ b/SunGather/sungather.py @@ -204,9 +204,6 @@ def load_registers(register_type, start, count=100): if register.get('multiple'): register_value = round(register_value * register.get('multiple'),2) - if register.get('zero_on_standby') and inverter["run_state"] == "OFF": - register_value = 0 - # Set the final register value with adjustments above included inverter[register_name] = register_value break