We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Had issues where single phase meter would not work as it would error when trying to retrieve the second phase details.
Amended def _update(self) as follows to zero out said variables for single phase meters:
def _update(self)
def _update(self): URL = "http://x.x.x.x/solar_api/v1/GetMeterRealtimeData.cgi?Scope=Device&DeviceId=0&DataCollection=MeterRealtimeData" meter_r = requests.get(url = URL) meter_data = meter_r.json() MeterModel = meter_data['Body']['Data']['Details']['Model']
MeterModel
meter_data['Body']['Data']['Details']['Model']
if str(MeterModel) == 'Smart Meter 63A-1': MeterConsumption = meter_data['Body']['Data']['PowerReal_P_Sum'] self._dbusservice['/Ac/Power'] = MeterConsumption # positive: consumption, negative: feed into grid self._dbusservice['/Ac/L1/Voltage'] = meter_data['Body']['Data']['Voltage_AC_Phase_1'] self._dbusservice['/Ac/L2/Voltage'] = 0 self._dbusservice['/Ac/L3/Voltage'] = 0 self._dbusservice['/Ac/L1/Current'] = meter_data['Body']['Data']['Current_AC_Phase_1'] self._dbusservice['/Ac/L2/Current'] = 0 self._dbusservice['/Ac/L3/Current'] = 0 self._dbusservice['/Ac/L1/Power'] = meter_data['Body']['Data']['PowerReal_P_Phase_1'] self._dbusservice['/Ac/L2/Power'] = 0 self._dbusservice['/Ac/L3/Power'] = 0 self._dbusservice['/Ac/Energy/Forward'] = meter_data['Body']['Data']['EnergyReal_WAC_Sum_Consumed'] self._dbusservice['/Ac/Energy/Reverse'] = meter_data['Body']['Data']['EnergyReal_WAC_Sum_Produced'] else: MeterConsumption = meter_data['Body']['Data']['PowerReal_P_Sum'] self._dbusservice['/Ac/Power'] = MeterConsumption # positive: consumption, negative: feed into grid self._dbusservice['/Ac/L1/Voltage'] = meter_data['Body']['Data']['Voltage_AC_Phase_1'] self._dbusservice['/Ac/L2/Voltage'] = meter_data['Body']['Data']['Voltage_AC_Phase_2'] self._dbusservice['/Ac/L3/Voltage'] = meter_data['Body']['Data']['Voltage_AC_Phase_3'] self._dbusservice['/Ac/L1/Current'] = meter_data['Body']['Data']['Current_AC_Phase_1'] self._dbusservice['/Ac/L2/Current'] = meter_data['Body']['Data']['Current_AC_Phase_2'] self._dbusservice['/Ac/L3/Current'] = meter_data['Body']['Data']['Current_AC_Phase_3'] self._dbusservice['/Ac/L1/Power'] = meter_data['Body']['Data']['PowerReal_P_Phase_1'] self._dbusservice['/Ac/L2/Power'] = meter_data['Body']['Data']['PowerReal_P_Phase_2'] self._dbusservice['/Ac/L3/Power'] = meter_data['Body']['Data']['PowerReal_P_Phase_3'] self._dbusservice['/Ac/Energy/Forward'] = meter_data['Body']['Data']['EnergyReal_WAC_Sum_Consumed'] self._dbusservice['/Ac/Energy/Reverse'] = `meter_data['Body']['Data']['EnergyReal_WAC_Sum_Produced']
logging.info("House Consumption: %s" % (MeterConsumption)) return True
The text was updated successfully, but these errors were encountered:
@unifiedcommsguy Just implemented and pushed a modified fix. Please check if this works for you. If so, please close this issue.
Sorry, something went wrong.
No branches or pull requests
Had issues where single phase meter would not work as it would error when trying to retrieve the second phase details.
Amended
def _update(self)
as follows to zero out said variables for single phase meters:def _update(self):
URL = "http://x.x.x.x/solar_api/v1/GetMeterRealtimeData.cgi?Scope=Device&DeviceId=0&DataCollection=MeterRealtimeData"
meter_r = requests.get(url = URL)
meter_data = meter_r.json()
MeterModel
=meter_data['Body']['Data']['Details']['Model']
if str(MeterModel) == 'Smart Meter 63A-1':
MeterConsumption = meter_data['Body']['Data']['PowerReal_P_Sum']
self._dbusservice['/Ac/Power'] = MeterConsumption # positive: consumption, negative: feed into grid
self._dbusservice['/Ac/L1/Voltage'] = meter_data['Body']['Data']['Voltage_AC_Phase_1']
self._dbusservice['/Ac/L2/Voltage'] = 0
self._dbusservice['/Ac/L3/Voltage'] = 0
self._dbusservice['/Ac/L1/Current'] = meter_data['Body']['Data']['Current_AC_Phase_1']
self._dbusservice['/Ac/L2/Current'] = 0
self._dbusservice['/Ac/L3/Current'] = 0
self._dbusservice['/Ac/L1/Power'] = meter_data['Body']['Data']['PowerReal_P_Phase_1']
self._dbusservice['/Ac/L2/Power'] = 0
self._dbusservice['/Ac/L3/Power'] = 0
self._dbusservice['/Ac/Energy/Forward'] = meter_data['Body']['Data']['EnergyReal_WAC_Sum_Consumed']
self._dbusservice['/Ac/Energy/Reverse'] = meter_data['Body']['Data']['EnergyReal_WAC_Sum_Produced']
else:
MeterConsumption = meter_data['Body']['Data']['PowerReal_P_Sum']
self._dbusservice['/Ac/Power'] = MeterConsumption # positive: consumption, negative: feed into grid
self._dbusservice['/Ac/L1/Voltage'] = meter_data['Body']['Data']['Voltage_AC_Phase_1']
self._dbusservice['/Ac/L2/Voltage'] = meter_data['Body']['Data']['Voltage_AC_Phase_2']
self._dbusservice['/Ac/L3/Voltage'] = meter_data['Body']['Data']['Voltage_AC_Phase_3']
self._dbusservice['/Ac/L1/Current'] = meter_data['Body']['Data']['Current_AC_Phase_1']
self._dbusservice['/Ac/L2/Current'] = meter_data['Body']['Data']['Current_AC_Phase_2']
self._dbusservice['/Ac/L3/Current'] = meter_data['Body']['Data']['Current_AC_Phase_3']
self._dbusservice['/Ac/L1/Power'] = meter_data['Body']['Data']['PowerReal_P_Phase_1']
self._dbusservice['/Ac/L2/Power'] = meter_data['Body']['Data']['PowerReal_P_Phase_2']
self._dbusservice['/Ac/L3/Power'] = meter_data['Body']['Data']['PowerReal_P_Phase_3']
self._dbusservice['/Ac/Energy/Forward'] = meter_data['Body']['Data']['EnergyReal_WAC_Sum_Consumed']
self._dbusservice['/Ac/Energy/Reverse'] = `meter_data['Body']['Data']['EnergyReal_WAC_Sum_Produced']
logging.info("House Consumption: %s" % (MeterConsumption))
return True
The text was updated successfully, but these errors were encountered: