Error fetching data API HomeAssistant.

Hi can you help me solve this error? 
Thank you 
Zsolt

Logger: homeassistant.components.rest.data
Source: components/rest/data.py:83
Integration: RESTful (documentation, issues)
First occurred: 13:03:11 (1 occurrences)
Last logged: 13:03:11

Error fetching data: https://www.iammeter.com/api/v1/site/meterdata/BB5F4E02?token=37b463390f2c4e38b8f29d9c685c7620 failed with [Errno -3] Try again

OR how can i use local api??

I try this but can't work.

http://192.168.XX.101/monitorjson

I don't know what happening, tomorrow morning is working, but the problem is some time isn't working.

Here is the tomorrow morning log, i think the error is a query limit. (19-01-2023)

Ez a hiba egy egyéni integrációból lett származtatva.

Logger: custom_components.iammeter_http
Source: helpers/update_coordinator.py:168
Integration: Iammeter_http
First occurred: 2023. január 18. 13:03:07 (2 occurrences)
Last logged: 05:20:07

Error fetching iammeter data: HTTPConnectionPool(host='192.168.88.101', port=80): Max retries exceeded with url: /monitorjson (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7f60e5760d60>: Failed to establish a new connection: [Errno 113] Host is unreachable'))
Error fetching iammeter data: HTTPConnectionPool(host='192.168.88.101', port=80): Max retries exceeded with url: /monitorjson (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7f60c74ff3d0>: Failed to establish a new connection: [Errno 111] Connection refused'))

Thread Status
9
331
3
0
0

Sort replies by:

Hi:

It is normal that the daily and monthly will not be the same.

Because they are not at the same start time point.


Please check whether the daily kWh is the same from the start of the second day.

And whether the monthly kWh is the same from the start of the second month.

2 days work normally, but tomorrow, doesn't work, here is the log.:

2023-01-21 18:47:14.970 ERROR (MainThread) [homeassistant.components.rest.data] Timeout while fetching data: https://www.iammeter.com/api/v1/site/meterdata/BB5F4E02?token=37b463390f2c4e38b8f29d9c685c7620

This is a server error??

Today grid consumption it't a little higher :D :D 

Hi:

https://www.iammeter.com/api/v1/site/meterdata/xxxxx

What you used is the open API that IAMMETER provided here

https://imeter.club/topic/18

It is a remote API that returns data from IAMMETER-cloud,not the local power meter.

we do not recommend reading the data in Home assistant in this way .

Because it needs internet access(your HA server request data from IAMMETER on the internet,not from the device locally)


OR how can i use local api??

I try this but can't work.

http://192.168.XX.101/monitorjson

Yes, both HACS-http and core integration of IAMMETER in HA use this local API.

what do you mean "I try this but can't work."

You put the URL in the browser but no response, YES?

If so ,please check whether it could recover after a power down/up reset.

And please also let me know your Ffirmware version ,please upgrade to the latest .

https://imeter.club/topic/11


By the way ,why do you investigate the API interface of IAMMETER in the Home assistant?

You can use the nearly step-by-step solution provided here.

https://www.iammeter.com/docs/summary-home-assistant

Hi Laoliu.

The local api is working, see the picture, but the HA is not GET the data, when i change the conf.yaml the data resources.

My FW version is 2.75.66, which is the best firmware? Wich firmware can i update? (number please)

Here is the conf.yaml the integration.:

- platform: rest
name: solar
json_attributes:
- data
- successful
- message
#resource: http://192.168.88.101/monitorjson (This resources commit now, and don't work)
resource: https://www.iammeter.com/api/v1/site/meterdata/BB5F4E02?token=37b463390f2c4e38b8f29d9c685c7620
method: GET
#username: admin
#password: admin
#authentication: basic

Thank You for your fast reply.





Hi:https://www.iammeter.com/api/v1/site/meterdata/xxxxxWhat you used is the open API that IAMMETER provided herehttps://imeter.club/topic/18It is a remote API that returns data from IAMMETER-cloud,not the local power meter.we do not recommend reading the data in Home assistant in this way .Because it needs internet access(your HA server request data from IAMMETER on the internet,not from the device locally)OR how can i use local api??I try this but can't work.http://192.168.XX.101/monitorjsonYes

"resource: https://www.iammeter.com/api/v1/site/meterdata/BB5F4E02?token=37b463390f2c4e38b8f29d9c685c7620"

Please let me know which document you referred to that use this resource.

In my opinion, we do not release a tutorial that lets users use this resource.

If you want to use the power meter in the home assistant

Please refer to https://www.iammeter.com/docs/summary-home-assistant

Just select one option in the above link.


I have already provided the URL of the latest firmware in the previous thread




Hi Laoliu,

The FW upgrade is done, the modbus integration is work.



Here is the template, and utility meter config, the daily and monthly data is not equal your app data.

inverter_power:
unit_of_measurement: 'W'
value_template: "{{ states('sensor.bb5f4e02_power_a')|float(0) + states('sensor.bb5f4e02_power_b')|float(0) + states('sensor.bb5f4e02_power_c')|float(0) }}"
feedin_power:
unit_of_measurement: 'W'
value_template: "{{ states('sensor.bb5f4e02_power_b')|float(0) * (-1.0) }}"
load_power:
unit_of_measurement: 'W'
value_template: "{{ states('sensor.bb5f4e02_power_a')|float(0) + states('sensor.bb5f4e02_power_b')|float(0) + states('sensor.bb5f4e02_power_c')|float(0) }}"
zero_power:
unit_of_measurement: 'W'
value_template: '{{ 0 }}'
grid_consumption_energy:
unit_of_measurement: 'kWh'
value_template: "{{ states('sensor.bb5f4e02_importenergy_a')|float(0) + states('sensor.bb5f4e02_importenergy_b')|float(0) + states('sensor.bb5f4e02_importenergy_c')|float(0) }}"
exported_energy:
unit_of_measurement: 'kWh'
value_template: "{{ states('sensor.bb5f4e02_exportgrid_a')|float(0) + states('sensor.bb5f4e02_exportgrid_b')|float(0) + states('sensor.bb5f4e02_exportgrid_c')|float(0) }}"
yield_energy:
unit_of_measurement: 'kWh'
value_template: "{{ states('sensor.bb5f4e02_importenergy_a')|float(0) + states('sensor.bb5f4e02_importenergy_b')|float(0) + states('sensor.bb5f4e02_importenergy_c')|float(0) }}"
selfuse_energy:
unit_of_measurement: 'kWh'
value_template: "{{ states('sensor.daily_yield')|float(0) - states('sensor.exported_energy')|float(0) }}"
load_energy:
unit_of_measurement: 'kWh'
value_template: "{{ states('sensor.grid_consumption_energy')|float(0) + states('sensor.yield_energy')|float(0) - states('sensor.exported_energy')|float(0) }}"#
self_consumption_rate_daily:
unit_of_measurement: '%'
value_template: "{{ states('sensor.selfuse_energy_daily')|float(0) / states('sensor.yield_energy_daily')|float(0) }}"
self_consumption_rate_monthly:
unit_of_measurement: '%'
value_template: "{{ states('sensor.selfuse_energy_monthly')|float(0) / states('sensor.yield_energy_monthly')|float(0) }}"

UTILITY METER CONF.:

utility_meter:
grid_consumption_energy_daily:
source: sensor.grid_consumption_energy
cycle: daily
grid_consumption_energy_monthly:
source: sensor.grid_consumption_energy
cycle: monthly

exported_energy_daily:
source: sensor.exported_energy
cycle: daily
exported_energy_monthly:
source: sensor.exported_energy
cycle: monthly

yield_energy_daily:
source: sensor.yield_energy
cycle: daily
yield_energy_monthly:
source: sensor.yield_energy
cycle: monthly

selfuse_energy_daily:
source: sensor.selfuse_energy
cycle: daily
selfuse_energy_monthly:
source: sensor.selfuse_energy
cycle: monthly

load_energy_daily:
source: sensor.load_energy
cycle: daily
load_energy_monthly:
source: sensor.load_energy
cycle: monthly

The data is home assistant is wrong.: (see the pictures)
Can you help me what is wrong, and what is the right template settings?
Thank you for your fast reply.

Hi:

It is normal that the daily and monthly will not be the same.

Because they are not at the same start time point.


Please check whether the daily kWh is the same from the start of the second day.

And whether the monthly kWh is the same from the start of the second month.

Hi Laoliu,The FW upgrade is done, the modbus integration is work.Here is the template, and utility meter config, the daily and monthly data is not equal your app data.inverter_power:        unit_of_measurement: 'W'        value_template: "{{ states('sensor.bb5f4e02_power_a')|float(0) + states('sensor.bb5f4e02_power_b')|float(0) + states('sensor.bb5f4e02_power_c')|float(0) }}"        feedin_power:        unit_of_measurement: 'W'        value_template: "{{ states('sensor.bb5f4e02_power_b')|float(0
Looks like you are new here. Register for free, learn and contribute.