Skip to content
New issue

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

More than 1 inverter #10

Closed
jojoro1 opened this issue Nov 24, 2019 · 67 comments
Closed

More than 1 inverter #10

jojoro1 opened this issue Nov 24, 2019 · 67 comments

Comments

@jojoro1
Copy link

jojoro1 commented Nov 24, 2019

How to get data from second inverter?

@TimSoethout
Copy link
Owner

Hi @jojoro1 , this is currently not possible, since you can only add one converter via configuration.

If we want to support this, I guess we should allow to configure multiple station id's and create separate sensors for them. Feel free to create a pull request for this.

@TimSoethout
Copy link
Owner

https://github.com/TimSoethout/goodwe-sems-home-assistant/blob/master/custom_components/sems/sensor.py#L36 should be called multiple times with different station id configuration.

@spaya1
Copy link

spaya1 commented May 6, 2020

Hi Tim,

I use this plugin with one inverter and I love it, I’m in the process of extending the system with a second inverter and I saw that it’s not possible by default with this plugin. I was wondering if you ever got to update the code to add multiple inverters. I have no clue about coding so want to know if it would be possible to add the functionality.

Appreciate if you can let me know so that when it’s not possible I look for a different brand of inverter that can be integrated in HA, so that I can run them both in HA as a single sensor.

Thx for the time and for keeping this alive.

Sergio

@TimSoethout
Copy link
Owner

TimSoethout commented May 7, 2020

Hi Sergio, I did not add this to the code yet, simply because I do not need the feature myself at the moment. Of course anyone is free to add it, and I will gladly merge it. Adding multiple inverters is definitely possible and useful. I might do it when I have some spare time, but don't count on it. Also I can't test myself if it works or not, since I do not have two inverters.

Ideally the configuration should not have to change for people just having one inverter: so simple config for single device and some more involved for more: devices: [ list of inverter configs ].
Although I'm not sure if this style is idiomatic style for home assistant components.

Also what do you think such a feature would look like from a user perspective?

@spaya1 , maybe for you a quick fix (hack) could be:

  • make a copy of the sems directory in custom components, name it sems2
  • in sems2/sensor.py change line 37 to use some other name: add_devices([SemsSensor("SEMS Portal **2**", config)], True)
  • copy your configuration for sems to sems2 and change the relevant fields.

I have not tested this, but it just might work.

@spaya1
Copy link

spaya1 commented May 7, 2020

Hi Tim,

Thanks for coming back so fast. I have tried the hack but it failed.

I have copied the sems folder to sems2 , so now in custom component I have both folders.

I have duplicated config to look like this:

  • platform: sems
    username: user
    password: pass
    station_id : id1
    scan_interval: 60

  • platform: sems2
    username: user
    password: pass
    station_id : id1
    scan_interval: 60

I dont have yet the second inverter, so I have copied the same station id twice.

I get two errors:

Error 1:
Logger: homeassistant.components.sensor
Source: custom_components/sems2/sensor.py:57
Integration: Sensor (documentation, issues)
First occurred: 10:28:36 AM (1 occurrences)
Last logged: 10:28:36 AM

Error while setting up sems2 platform for sensor
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 186, in _async_setup_platform
await asyncio.gather(*pending)
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 295, in async_add_entities
await asyncio.gather(*tasks)
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 445, in _async_add_entity
entity.async_write_ha_state()
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 297, in async_write_ha_state
self._async_write_ha_state() # type: ignore
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 320, in _async_write_ha_state
state = self.state
File "/config/custom_components/sems2/sensor.py", line 57, in state
return self._attributes['status']
KeyError: 'status'

Error2:
Logger: custom_components.sems2.sensor
Source: custom_components/sems2/sensor.py:118
Integration: sems2 (documentation)
First occurred: 10:28:36 AM (1 occurrences)
Last logged: 10:28:36 AM

Unable to fetch data from SEMS. 'NoneType' object is not subscriptable

@TimSoethout
Copy link
Owner

@spaya1
Copy link

spaya1 commented May 7, 2020

Hi Tim, i did change it before restarting HA.
{
"domain": "sems2",
"name": "Goodwe SEMS API",
"documentation": "https://github.com/TimSoethout/goodwe-sems-home-assis$
"dependencies": [],
"codeowners": ["@TimSoethout"],
"requirements": []

@TimSoethout
Copy link
Owner

TimSoethout commented May 7, 2020

I'm not sure what goes wrong here. You could try turning on debug logging and see if it gives us more information: https://www.home-assistant.io/integrations/logger/

@spaya1
Copy link

spaya1 commented May 7, 2020

Hi Tim,

It seems that sems2 is working now but sems is not :)

I added this:

logger:
default: info
logs:
homeassistant.components.sems: debug

I am getting this new error:

Logger: custom_components.sems.sensor
Source: custom_components/sems/sensor.py:118
Integration: sems (documentation)
First occurred: 11:28:51 AM (1 occurrences)
Last logged: 11:28:51 AM

Unable to fetch data from SEMS. HTTPSConnectionPool(host='www.semsportal.com', port=443): Read timed out. (read timeout=30)

@TimSoethout
Copy link
Owner

You can add homeassistant.components.sems2: debug as well for more info.

It seems that the api does not like 2 requests (for the same inverter) at the same time maybe?

@spaya1
Copy link

spaya1 commented May 7, 2020

Hi Tim,

I have added it, but it doesnt add any new information besides what I have added earlier:

Error 1:

Logger: homeassistant.components.sensor
Source: custom_components/sems2/sensor.py:57
Integration: Sensor (documentation, issues)
First occurred: 11:45:07 AM (1 occurrences)
Last logged: 11:45:07 AM

Error while setting up sems2 platform for sensor
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 186, in _async_setup_platform
await asyncio.gather(*pending)
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 295, in async_add_entities
await asyncio.gather(*tasks)
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 445, in _async_add_entity
entity.async_write_ha_state()
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 297, in async_write_ha_state
self._async_write_ha_state() # type: ignore
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 320, in _async_write_ha_state
state = self.state
File "/config/custom_components/sems2/sensor.py", line 57, in state
return self._attributes['status']
KeyError: 'status'

Error 2:

Logger: custom_components.sems2.sensor
Source: custom_components/sems2/sensor.py:118
Integration: sems2 (documentation)
First occurred: 11:45:07 AM (1 occurrences)
Last logged: 11:45:07 AM

Unable to fetch data from SEMS. 'NoneType' object is not subscriptable

I tried to install the mqtt2sems plugin, it works but it makes my HA system crash, (had to restart my raspberry 3 times in the mean time, so I disabled it for now) so want to continue your route if possible.

@TimSoethout
Copy link
Owner

Oke. Well it should be definitely possible, but ideally we have someone with 2 inverters already to try this out. Maybe the SEMS API system blocks simultaneous logins or requests. Or it is because you're using the same inverter id twice.

Also this hack is taking too much effort already compared to just implementing multiple inverters correctly. :P
If I have some free time tonight, I might start implementing it. :)

@spaya1
Copy link

spaya1 commented May 7, 2020

Well if its too much work i can go with Growatt for the same price, so I could interface both brands under one sensor, would prefer Goodwe as it has higher efficiency, but I also dont want to force it. In any case, they said it would take 4 weeks before they are able to install so there is time to continue playing :)

@spaya1
Copy link

spaya1 commented May 26, 2020

Hello Tim, hope you are fine. I got the second inverter installed :)

As expected it only reads one. I have setup both inverters under the same plant, and under the sems sensor in HA it only detects the first inverter (new one) and the old one has dissappeared.

In the sems application it does detect the increase in power as you can see below.

image

@TimSoethout
Copy link
Owner

That makes sense, because we only add the values of the first inverter: jsonResponseFinal["data"]["inverter"][0]["invert_full"].items()

To show the other inverters, we would need to add the values of all inverters, by looping over `jsonResponseFinal["data"]["inverter"], which should be a list of inverters.
But how should we name the values?

  • Do we expect multiple devices in HA, one for each inverter?
  • Or one global SEMS device (as it is now), with prefixed inverter ids or something?

The first seems more proper, but also harder to implement if we don't want to do multiple API request per plant.

@spaya1
Copy link

spaya1 commented May 26, 2020

For me the ideal case is when you have n sensors, so SEMS_Portal_n, that way you can monitor the inverters separately, and add them together under one sensor if you want.

I dont expect many people to have more than 2 inverters, I also think having two inverters is not common (in my case it was 350e vs 950e to go for 2 inverters vs 1 big one).

Option two is possible, you just need to call the right attribute under a new sensor and you are done right?

Eg:

Inverter1: states.sensor.sems_portal.attributes["outputpower"]
Inverter2: states.sensor.sems_portal.attributes["outputpower_2"]

@TimSoethout
Copy link
Owner

I'm building a new version in this branch: https://github.com/TimSoethout/goodwe-sems-home-assistant/tree/%2310-multiple-inverters%2Basync

It is not finished, but it should display multiple inverters. Their names are the inverters serial numbers for now, but I plan to change this.

Can you test if it indeed adds multiple devices for each of your inverters?

@spaya1
Copy link

spaya1 commented May 29, 2020

Hi Tim, good morning.

Thanks for the effort, I have loaded the branch but see the same sensors created with only the new inverter showing (same as before).

Do the sensors have a different name now? I have a GW2000-ns and GW2000-xs, when I search in the state tab for "2000" I only get returned GW2000-xs in the sems_portal sensor.

@TimSoethout
Copy link
Owner

They should have diffeerent names. If you enable debug logging you should see something like this in the logs: DEBUG (MainThread) [custom_components.sems.sensor] Found inverter attribute GoodweName X3000SSNXXXXX

@spaya1
Copy link

spaya1 commented May 29, 2020

Hi Tim,

I must be doing wrong, I have set it up under sems3, and this is my config:

  • platform: sems3
    username:
    password:
    station_id:
    scan_interval: 60

logger:
default: info
logs:
homeassistant.components.sems3: debug

I have extended the log and all I can see with sems is this:

2020-05-29 08:20:53 WARNING (MainThread) [homeassistant.loader] You are using a custom integration for sems3 which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant.

2020-05-29 08:20:55 INFO (MainThread) [homeassistant.components.sensor] Setting up sensor.sems3

but beyond this, there is no more info

@spaya1
Copy link

spaya1 commented May 29, 2020

nvm my logger was wrongly configured...

2020-05-29 08:28:57 DEBUG (SyncWorker_6) [custom_components.sems3.sensor] REST Response Recieved
2020-05-29 08:28:57 DEBUG (SyncWorker_6) [custom_components.sems3.sensor] Updated attribute sn: ----
2020-05-29 08:28:57 DEBUG (SyncWorker_6) [custom_components.sems3.sensor] Updated attribute powerstation_id: ----
2020-05-29 08:28:57 DEBUG (SyncWorker_6) [custom_components.sems3.sensor] Updated attribute name: ----
2020-05-29 08:28:57 DEBUG (SyncWorker_6) [custom_components.sems3.sensor] Updated attribute model_type: GW2000-XS

This is the only one it finds

@TimSoethout
Copy link
Owner

TimSoethout commented May 29, 2020

You should see something like this:

2020-05-28 22:23:38 DEBUG (MainThread) [custom_components.sems.sensor] REST Response Received
2020-05-28 22:23:38 DEBUG (MainThread) [custom_components.sems.sensor] Found inverter attribute GoodweName SNXXXXX
2020-05-28 22:23:38 DEBUG (MainThread) [custom_components.sems.sensor] Found inverter attribute GoodweName SNXXXXX (Second inverter)
2020-05-28 22:23:38 DEBUG (MainThread) [custom_components.sems.sensor] Finished fetching SEMS Portal data in 0.557 seconds

(maybe with sems3 for you).

Are you sure you are running the new version? Those "update attribute XXXX" for each attribute should not be visible in the new version. You have to use the specific branch #10-multiple-inverters+async, and not master

@spaya1
Copy link

spaya1 commented May 29, 2020

Hi Tim,

I am pretty sure I do, I have opened the file and compared with the branch code.

I have reset again and now get a new error:

Logger: homeassistant.util.async_
Source: util/async_.py:120
First occurred: 8:55:39 (4 occurrences)
Last logged: 8:56:39

Detected I/O inside the event loop. This is causing stability issues. Please report issue to the custom component author for sems3 doing I/O at custom_components/sems3/sensor.py, line 63: _LoginURL, headers=login_headers, data=login_data, timeout=_RequestTimeout)
Detected I/O inside the event loop. This is causing stability issues. Please report issue to the custom component author for sems3 doing I/O at custom_components/sems3/sensor.py, line 98: _PowerStationURL, headers=headers, data=data, timeout=_RequestTimeout)

It does show the info you mentioned earlier in the log, but no sensor created for this.

2020-05-29 09:02:25 DEBUG (MainThread) [custom_components.sems3.sensor] REST Response Received
2020-05-29 09:02:25 DEBUG (MainThread) [custom_components.sems3.sensor] Found inverter attribute NAMENEWPV SN
2020-05-29 09:02:25 DEBUG (MainThread) [custom_components.sems3.sensor] Found inverter attribute NAMEOLDPV SN
2020-05-29 09:02:25 DEBUG (MainThread) [custom_components.sems3.sensor] Finished fetching SEMS Portal data in 1.049 seconds

Error in detail shows this ( i have made xxx in some token areas to avoid issues)

020-05-29 09:02:24 DEBUG (MainThread) [custom_components.sems3.sensor] SEMS - Getting API token
2020-05-29 09:02:24 WARNING (MainThread) [homeassistant.util.async_] Detected I/O inside the event loop. This is causing stability issues. Please report issue to the custom component author for sems3 doing I/O at custom_components/sems3/sensor.py, line 63: _LoginURL, headers=login_headers, data=login_data, timeout=RequestTimeout)
2020-05-29 09:02:24 DEBUG (MainThread) [custom_components.sems3.sensor] Login JSON response {'hasError': False, 'code': 0, 'msg': 'Success', 'data': {'uid': '6b226682-xxxxx', 'timestamp': 1590735744636, 'token': 'ec7889e5d9b6c461105dxxxx', 'client': 'web', 'version': '', 'language': 'en'}, 'components': {'para': None, 'langVer': 69, 'timeSpan': 0, 'api': 'http://eu.semsportal.com:82/api/Auth/GetToken', 'msgSocketAdr': 'https://eu-xxzx.semsportal.com'}, 'api': 'https://eu.semsportal.com/api/'}
2020-05-29 09:02:24 DEBUG (MainThread) [custom_components.sems3.sensor] SEMS - API Token received: SemsApiToken(requestTimestamp=1590735744636, requestUID='6b226682-7001-4acd-855cxxxxxx', requestToken='ec7889e5d9b6c461105d8xxxxx')
2020-05-29 09:02:24 DEBUG (MainThread) [custom_components.sems3.sensor] update called.
2020-05-29 09:02:24 DEBUG (MainThread) [custom_components.sems3.sensor] SEMS - Making Power Station Status API Call
2020-05-29 09:02:24 WARNING (MainThread) [homeassistant.util.async
] Detected I/O inside the event loop. This is causing stability issues. Please report issue to the custom component author for sems3 doing I/O at custom_components/sems3/sensor.py, line 98: _PowerStationURL, headers=headers, data=data, timeout=_RequestTimeout)
2020-05-29 09:02:25 DEBUG (MainThread) [custom_components.sems3.sensor] REST Response Received
2020-05-29 09:02:25 DEBUG (MainThread) [custom_components.sems3.sensor] Found inverter attribute NAMENEWPV SN
2020-05-29 09:02:25 DEBUG (MainThread) [custom_components.sems3.sensor] Found inverter attribute NAMEOLDPV SN
2020-05-29 09:02:25 DEBUG (MainThread) [custom_components.sems3.sensor] Finished fetching SEMS Portal data in 1.049 seconds

@TimSoethout
Copy link
Owner

I have to fix those IO warnings still, but they should not keep it from working.
This is indeed the output I expected.

It should have the two new devices with the SN's as names now. Weird that you don't get them. Since your log indicate it should be working as expected (for now).

@spaya1
Copy link

spaya1 commented May 29, 2020

A new reboot, and they show up :)

Are these names end state? Then I can start building my sensors around them :)

Thanks!! 👍

@TimSoethout
Copy link
Owner

TimSoethout commented May 29, 2020 via email

@spaya1
Copy link

spaya1 commented May 29, 2020

Yes, it does!

Also because I cannot show attributes for the new sensors, and I dont know if its related to the name.

In template:
{{states.sensor.92000ssn18bwXXXX.attributes.pac}} should show 1400

but shows

Error rendering template: TemplateSyntaxError: expected token 'end of print statement', got 'ssn18bwXXXX'

@TimSoethout
Copy link
Owner

TimSoethout commented May 29, 2020

I don't know why that doesn't work, this seems to work: {{states.sensor['XXXSNXXX'].attributes.pac}}

My gut feeling says that python does not like names/variables to start with a number.

@TimSoethout
Copy link
Owner

TimSoethout commented Apr 14, 2021 via email

@TimSoethout
Copy link
Owner

TimSoethout commented Apr 14, 2021

Ok, I just finished a working version of this on branch #10-multiple-inverters+async.
Feel free to test.
If I find some more time I will release a beta version + update documentation.

@spaya1
Copy link

spaya1 commented Apr 14, 2021

Hi Tim,

thanks for the work, I loaded the branch, and I get the following error:

Logger: homeassistant.components.sensor
Source: helpers/entity_platform.py:128
Integration: Sensor (documentation, issues)
First occurred: 5:46:48 PM (1 occurrences)
Last logged: 5:46:48 PM

The semstest platform for the sensor integration does not support platform setup. Please remove it from your config.

This is my config (same as before, I edited the manifest to ensure it detects it):

  • platform: semstest
    username: ''
    password: ''
    station_id : ''
    scan_interval: 60

@TimSoethout
Copy link
Owner

TimSoethout commented Apr 14, 2021 via email

@spaya1
Copy link

spaya1 commented Apr 14, 2021

Hi Tim,

What I get:

Setup failed for sems: No setup or config entry setup function defined.
6:17:58 PM – (ERROR) setup.py

Logger: homeassistant.setup
Source: setup.py:163
First occurred: 6:17:58 PM (1 occurrences)
Last logged: 6:17:58 PM

Setup failed for sems: No setup or config entry setup function defined.

image

image

I have also restored the manifest to sems

image

@TimSoethout
Copy link
Owner

Your setup seems to be fine. The integration should show up.
image

I'm currently trying to also setup again with the code from scratch to see if I missed something.

@spaya1
Copy link

spaya1 commented Apr 14, 2021

Hi Tim,

I managed to get it to load as a platform. However I get a sensor called SEMS portal where I only see a single inverter.

I used to get 2 sensors, one per inverter.

image

this used to be my calculation:
pv_outputpower:
value_template: "{{ ((states.sensor['92000xxx'].state | float) + (states.sensor['52000xxx'].state | float)) | round(2) /1000 }}"
unit_of_measurement: 'kW'

@TimSoethout
Copy link
Owner

sems_portal is name used the old version (based on current master branch). Are you sure, you're using the code from the #10-multiple-inverters+async branch?

@spaya1
Copy link

spaya1 commented Apr 14, 2021

Hi Tim,

Pretty sure, is there a way to check in the code?

image

@TimSoethout
Copy link
Owner

You indeed have the correct code, since you have the config_flow file and translations folder... Hmm.. Not sure what is happening. Is the sems_portal sensor maybe an old one still registered in HA?

Can you try removing all of sems mentions from your configuration file? It seems it is not needed after all.
Is it now possible to add the integration via gui?

@spaya1
Copy link

spaya1 commented Apr 14, 2021

Will try now, but I never had the sems_portal sensor before.

@spaya1
Copy link

spaya1 commented Apr 14, 2021

Ok so I was able to pull the gui

image

But now it picks the second inverter only xD

image

I would expect here 2 entities

image

Did I do something wrong?

@TimSoethout
Copy link
Owner

Cool! Progress! You should be able to add the integration twice with the different powerstation id's. At least that was the idea. I can only test with one. :P

@spaya1
Copy link

spaya1 commented Apr 14, 2021

In my case the plant name is the same for both inverters :). The curious thing is that before (with platform setup) it was showing Inverter 1, and now (with gui setup) it shows Inverter 2.

@TimSoethout
Copy link
Owner

TimSoethout commented Apr 14, 2021 via email

@spaya1
Copy link

spaya1 commented Apr 14, 2021

If you tell me how I can load the api, I can look which are the fields that hold the 2 serial numbers that I am looking for :)

@TimSoethout
Copy link
Owner

You can login to https://semsportal.com and in your browsers developer tools on the network tab you can see the different api calls with their JSON responses. Will that help?

@spaya1
Copy link

spaya1 commented Apr 14, 2021

"releation_id": "147cb869-xxx",
"type": "GW2000-NS",
"capacity": 2.0,
"d": {
"pw_id": "5c4e9558-xxx",
"capacity": "2kW",
"model": "GW2000-NS"

    "invert_full": {
      "sn": "92000xxx",
      "powerstation_id": "5c4e9558-442f-xxxx",
      "name": "Old PV",
      "model_type": "GW2000-NS",

"releation_id": "50e0e175-xxx",
"type": "GW2000-XS",
"capacity": 2.0,
"d": {
"pw_id": "5c4e9558-xxx",
"capacity": "2kW",
"model": "GW2000-XS",

"invert_full": {
"sn": "52000xxx",
"powerstation_id": "5c4e9558-xxxx",
"name": "52000xxx",
"model_type": "GW2000-XS",
"change_type": 0,

@TimSoethout
Copy link
Owner

Ok, I just pushed a change that used the inverters serial number as unique id for the HA entity. Maybe this will work already when you re-add the integration.

@spaya1
Copy link

spaya1 commented Apr 14, 2021

Got two sensors showing now, both for the same inverter, the old one shows unavailable, the new one works and has a new name (the inverter name)

image

image

@spaya1
Copy link

spaya1 commented Apr 14, 2021

Ok, I just pushed a change that used the inverters serial number as unique id for the HA entity. Maybe this will work already when you re-add the integration.

how about using releation_id as unique identifier?

@TimSoethout
Copy link
Owner

Yes, I changed some stuff with unique id's and display names. HA might show some old id's/names as well.

I just released a version based on serial number: https://github.com/TimSoethout/goodwe-sems-home-assistant/releases/tag/3.1.0-beta2
This one should also work with HACS if you turn beta versions on.
Now I'm off to bed. I hope this works. :)

About the releation_id, that might also work, as long as it's unique per inverter.

@TimSoethout
Copy link
Owner

Thanks for all the feedback @spaya1 . If this one works, I'll promote it to the new normal version.

@spaya1
Copy link

spaya1 commented Apr 14, 2021

I tried left and right to install via beta, but I was only seeing 1.0.0 and 1.0.1 so I downloaded the src code from the link you shared.

At first it didn't work, it showed the old sensors, but then they were both unavailable. So I removed the integration and added it again (via gui). Now it seems to work 👍

image

image

image

I owe you some bitterballen!

@spaya1
Copy link

spaya1 commented Apr 15, 2021

Hi Tim,

Good morning, for some reason I cannot access semsportal via the app anymore :), it times out.

I would hold before making this part of the master branch. Is this an issue at Goodwe side (do you have the same today?) or is it the beta integration?

In hassio I am getting the following error:

Logger: custom_components.sems.sensor
Source: helpers/update_coordinator.py:205
Integration: GoodWe SEMS PV API (documentation, issues)
First occurred: 8:58:12 AM (1 occurrences)
Last logged: 8:58:12 AM

Error fetching SEMS API data: Error communicating with API: 'NoneType' object is not iterable


Logger: custom_components.sems.sems_api
Source: custom_components/sems/sems_api.py:84
Integration: GoodWe SEMS PV API (documentation, issues)
First occurred: 8:58:12 AM (1 occurrences)
Last logged: 8:58:12 AM

Unable to fetch login token from SEMS API. HTTPSConnectionPool(host='www.semsportal.com', port=443): Read timed out. (read timeout=60)


Logger: custom_components.sems.sems_api
Source: custom_components/sems/sems_api.py:126
Integration: GoodWe SEMS PV API (documentation, issues)
First occurred: 8:58:12 AM (1 occurrences)
Last logged: 8:58:12 AM

Unable to fetch data from SEMS. 'NoneType' object has no attribute 'requestTimestamp

@TimSoethout
Copy link
Owner

TimSoethout commented Apr 15, 2021

2021-04-15 08:08:11 ERROR (SyncWorker_6) [custom_components.sems.sems_api] Unable to fetch data from SEMS. 'NoneType' object has no attribute 'requestTimestamp'
2021-04-15 08:08:11 ERROR (MainThread) [custom_components.sems.sensor] Error fetching SEMS API data: Error communicating with API: 'NoneType' object is not iterable

I get some of these with the new beta version.
I also see them on my "production" system running on 1.0.1.
However, it's not all the time and on both I also get data.

It seems the portal logs you out when you login elsewhere (e.g. via the integration). Maybe for your 2 inverters they log each other out?

I guess the code should reuse logins somehow... But that would take some more development and looking into how to do that.

@spaya1
Copy link

spaya1 commented Apr 15, 2021

Alright, then this is ready for production in that case. I also have the pvoutput integration (outside of hassio), but that connects to the api, and updates the site every 5 minutes. So dont think its related.

Thanks again!

TimSoethout added a commit that referenced this issue Apr 16, 2021
@TimSoethout
Copy link
Owner

Should be solved by #26 and released as version 3.1.0. :D

Thanks for the debugging/testing support @spaya1.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants