Yes certainly does, not sure how that can be. So this would imply it is not getting fresh data from our Inverters ???
Hopefully sparkydave can help
Are you able to post a pic of your Data as mine is showing old historical data used to test the component
Thanks
Info from today. still not updating and using old data as seen above in other threads.
Screens shots shows today (some should be zero or unknown as sun not up yet
Also included info from my rest sensors to show inverter working correctly
Its in debug mode. I had hardcoded my URL where I had mock data:
https://my-json-server.typicode.com/safepay/json/test
This was for someone to compare my mock data with their real data.
I have uploaded a new debug version that hardcodes a few things but should work with your ip_address in the config (it assumes a device_id of 1).
Can someone please do two things:
- compare my mock data with the real inverter data via the two URL’s.
- Run the new code and look in the logs for the various debug outputs - they have lots of “!!!” at the start.
Cheers
It’ll be a couple more hours before I get decent sun on my panels, still dark outside but I’ll try and get something later today if I get home from work during daylight
Using latest sensor.py back to the original errors
error log
2019-07-10 11:02:45 ERROR (MainThread) [homeassistant.components.sensor] fronius: Error on device update!
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 261, in _async_add_entity
await entity.async_device_update(warning=False)
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 377, in async_device_update
await self.hass.async_add_executor_job(self.update)
File "/usr/local/lib/python3.7/concurrent/futures/thread.py", line 57, in run
result = self.fn(*self.args, **self.kwargs)
File "/config/custom_components/fronius/sensor.py", line 127, in update
self._state = round(self._data.latest_data[self._json_key]["Value"], 1)
TypeError: 'NoneType' object is not subscriptable
2019-07-10 11:02:45 ERROR (MainThread) [homeassistant.components.sensor] fronius: Error on device update!
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 261, in _async_add_entity
await entity.async_device_update(warning=False)
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 377, in async_device_update
await self.hass.async_add_executor_job(self.update)
File "/usr/local/lib/python3.7/concurrent/futures/thread.py", line 57, in run
result = self.fn(*self.args, **self.kwargs)
File "/config/custom_components/fronius/sensor.py", line 125, in update
self._state = round(self._data.latest_data[self._json_key]["Value"] / 1000, 1)
TypeError: 'NoneType' object is not subscriptable
2019-07-10 11:02:45 ERROR (MainThread) [homeassistant.components.sensor] fronius: Error on device update!
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 261, in _async_add_entity
await entity.async_device_update(warning=False)
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 377, in async_device_update
await self.hass.async_add_executor_job(self.update)
File "/usr/local/lib/python3.7/concurrent/futures/thread.py", line 57, in run
result = self.fn(*self.args, **self.kwargs)
File "/config/custom_components/fronius/sensor.py", line 127, in update
self._state = round(self._data.latest_data[self._json_key]["Value"], 1)
TypeError: 'NoneType' object is not subscriptable
2019-07-10 11:02:45 ERROR (MainThread) [homeassistant.components.sensor] fronius: Error on device update!
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 261, in _async_add_entity
await entity.async_device_update(warning=False)
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 377, in async_device_update
await self.hass.async_add_executor_job(self.update)
File "/usr/local/lib/python3.7/concurrent/futures/thread.py", line 57, in run
result = self.fn(*self.args, **self.kwargs)
File "/config/custom_components/fronius/sensor.py", line 127, in update
self._state = round(self._data.latest_data[self._json_key]["Value"], 1)
TypeError: 'NoneType' object is not subscriptable
2019-07-10 11:02:45 ERROR (MainThread) [homeassistant.components.sensor] fronius: Error on device update!
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 261, in _async_add_entity
await entity.async_device_update(warning=False)
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 377, in async_device_update
await self.hass.async_add_executor_job(self.update)
File "/usr/local/lib/python3.7/concurrent/futures/thread.py", line 57, in run
result = self.fn(*self.args, **self.kwargs)
File "/config/custom_components/fronius/sensor.py", line 127, in update
self._state = round(self._data.latest_data[self._json_key]["Value"], 1)
TypeError: 'NoneType' object is not subscriptable
2019-07-10 11:02:45 ERROR (MainThread) [homeassistant.components.sensor] fronius: Error on device update!
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 261, in _async_add_entity
await entity.async_device_update(warning=False)
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 377, in async_device_update
await self.hass.async_add_executor_job(self.update)
File "/usr/local/lib/python3.7/concurrent/futures/thread.py", line 57, in run
result = self.fn(*self.args, **self.kwargs)
File "/config/custom_components/fronius/sensor.py", line 125, in update
self._state = round(self._data.latest_data[self._json_key]["Value"] / 1000, 1)
TypeError: 'NoneType' object is not subscriptable
2019-07-10 11:02:45 ERROR (MainThread) [homeassistant.components.sensor] fronius: Error on device update!
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 261, in _async_add_entity
await entity.async_device_update(warning=False)
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 377, in async_device_update
await self.hass.async_add_executor_job(self.update)
File "/usr/local/lib/python3.7/concurrent/futures/thread.py", line 57, in run
result = self.fn(*self.args, **self.kwargs)
File "/config/custom_components/fronius/sensor.py", line 127, in update
self._state = round(self._data.latest_data[self._json_key]["Value"], 1)
TypeError: 'NoneType' object is not subscriptable
2019-07-10 11:02:45 ERROR (MainThread) [homeassistant.components.sensor] fronius: Error on device update!
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 261, in _async_add_entity
await entity.async_device_update(warning=False)
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 377, in async_device_update
await self.hass.async_add_executor_job(self.update)
File "/usr/local/lib/python3.7/concurrent/futures/thread.py", line 57, in run
result = self.fn(*self.args, **self.kwargs)
File "/config/custom_components/fronius/sensor.py", line 127, in update
self._state = round(self._data.latest_data[self._json_key]["Value"], 1)
TypeError: 'NoneType' object is not subscriptable
2019-07-10 11:02:46 ERROR (MainThread) [homeassistant.components.sensor] fronius: Error on device update!
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 261, in _async_add_entity
await entity.async_device_update(warning=False)
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 377, in async_device_update
await self.hass.async_add_executor_job(self.update)
File "/usr/local/lib/python3.7/concurrent/futures/thread.py", line 57, in run
result = self.fn(*self.args, **self.kwargs)
File "/config/custom_components/fronius/sensor.py", line 125, in update
self._state = round(self._data.latest_data[self._json_key]["Value"] / 1000, 1)
TypeError: 'NoneType' object is not subscriptable
Thanks.
Did you find “!!! HEADER TIMESTAMP” line in the logs?
Or the “Fronius URL” line in the logs?
And can you compare your direct URL with my test URL - ideally paste the raw data in code format directly from the logged URL.
Will check Url when back home
but happy to give you the full log
URL in Log
2019-07-10 11:02:40 INFO (SyncWorker_7) [custom_components.fronius.sensor] Fronius URL: http://192.168.0.6/solar_api/v1/GetInverterRealtimeData.cgi?Scope=system&DeviceId=1&DataCollection=CommonInverterData
And Header
2019-07-10 11:02:45 INFO (SyncWorker_7) [custom_components.fronius.sensor] !!! HEADER TIMESTAMP: 2019-07-10T11:02:43+12:00
Great. That shows that the URL is working and that individual items can be extracted from it.
Just tested URL and it fails but if you compare your URL and what is being produced by the code they are different ie
Yours
http://ip_address/GetInverterRealtimeData.cgi?Scope=Device&DeviceId=1&DataCollection=CommonInverterData
Scope= is different on them ie yours is set to “Device” the code sets it to “system”
It should be “Device” also note “system” has to be “System” (case sensitive) to work but you get a different output
All working. now I edited the sensor.py to fix the error in the Url ie “system” to “Device”
and all works thank you so much and getting live data
Yep, that’ll do it. Good on you.
I’ll upload a final code for everyone.
Great thanks
Actually Kevin, the problem the whole time must have been the case sensitivity of “device” vs “Device”.
I just fixed that in my final code.
Great thanks for all your work
I just checked my dev tools for the power output and noticed it hasn’t updated in 17hrs. I’m using the code from the got repo as it was yesterday afternoon. How often is the data supposed to update in HA? Obviously more often than mine currently is…
You need to get the new sensor.py as it has the fixed url creation,
Above post talks about what is changed
Thanks will put new final code in today when I get home. Thanks you for all your work
@safepay good work
No rush but I going to find out how but it will be good to have
Line 29
MIN_TIME_BETWEEN_UPDATES = timedelta(minutes=5)
In the config.
I going to ask round to help out so it will look like this
` - platform: fronius
ip_address: "192.168.0.219"
time between updates: 5
`
Yes, its typically
polling_interval: 5
to get that going.
It’s pretty easy to add.