Giter Club home page Giter Club logo

Comments (67)

spaya1 avatar spaya1 commented on August 10, 2024 1

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!

from goodwe-sems-home-assistant.

TimSoethout avatar TimSoethout commented on August 10, 2024

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.

from goodwe-sems-home-assistant.

TimSoethout avatar TimSoethout commented on August 10, 2024

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.

from goodwe-sems-home-assistant.

spaya1 avatar spaya1 commented on August 10, 2024

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

from goodwe-sems-home-assistant.

TimSoethout avatar TimSoethout commented on August 10, 2024

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.

from goodwe-sems-home-assistant.

spaya1 avatar spaya1 commented on August 10, 2024

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

from goodwe-sems-home-assistant.

TimSoethout avatar TimSoethout commented on August 10, 2024

Maybe you need to change https://github.com/TimSoethout/goodwe-sems-home-assistant/blob/master/custom_components/sems/manifest.json also to sems2?

from goodwe-sems-home-assistant.

spaya1 avatar spaya1 commented on August 10, 2024

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": []

from goodwe-sems-home-assistant.

TimSoethout avatar TimSoethout commented on August 10, 2024

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/

from goodwe-sems-home-assistant.

spaya1 avatar spaya1 commented on August 10, 2024

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)

from goodwe-sems-home-assistant.

TimSoethout avatar TimSoethout commented on August 10, 2024

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?

from goodwe-sems-home-assistant.

spaya1 avatar spaya1 commented on August 10, 2024

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.

from goodwe-sems-home-assistant.

TimSoethout avatar TimSoethout commented on August 10, 2024

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. :)

from goodwe-sems-home-assistant.

spaya1 avatar spaya1 commented on August 10, 2024

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 :)

from goodwe-sems-home-assistant.

spaya1 avatar spaya1 commented on August 10, 2024

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

from goodwe-sems-home-assistant.

TimSoethout avatar TimSoethout commented on August 10, 2024

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.

from goodwe-sems-home-assistant.

spaya1 avatar spaya1 commented on August 10, 2024

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"]

from goodwe-sems-home-assistant.

TimSoethout avatar TimSoethout commented on August 10, 2024

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?

from goodwe-sems-home-assistant.

spaya1 avatar spaya1 commented on August 10, 2024

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.

from goodwe-sems-home-assistant.

TimSoethout avatar TimSoethout commented on August 10, 2024

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

from goodwe-sems-home-assistant.

spaya1 avatar spaya1 commented on August 10, 2024

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

from goodwe-sems-home-assistant.

spaya1 avatar spaya1 commented on August 10, 2024

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

from goodwe-sems-home-assistant.

TimSoethout avatar TimSoethout commented on August 10, 2024

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

from goodwe-sems-home-assistant.

spaya1 avatar spaya1 commented on August 10, 2024

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

from goodwe-sems-home-assistant.

TimSoethout avatar TimSoethout commented on August 10, 2024

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).

from goodwe-sems-home-assistant.

spaya1 avatar spaya1 commented on August 10, 2024

A new reboot, and they show up :)

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

Thanks!! πŸ‘

from goodwe-sems-home-assistant.

TimSoethout avatar TimSoethout commented on August 10, 2024

from goodwe-sems-home-assistant.

spaya1 avatar spaya1 commented on August 10, 2024

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'

from goodwe-sems-home-assistant.

TimSoethout avatar TimSoethout commented on August 10, 2024

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.

from goodwe-sems-home-assistant.

TimSoethout avatar TimSoethout commented on August 10, 2024

Note that the state of the sensor now represents the pac instead of the on/off status:

{{states.sensor['XXXSNXXX'].state}} == {{states.sensor['XXXSNXXX'].attributes.pac}}

from goodwe-sems-home-assistant.

spaya1 avatar spaya1 commented on August 10, 2024

Ah that is great. I see that there is someone else facing something similar:

https://community.home-assistant.io/t/issue-with-template-in-binary-sensor/8687/8

So I will wait until the new sensors names are merged and will use those :)

from goodwe-sems-home-assistant.

spaya1 avatar spaya1 commented on August 10, 2024

Hi Tim,

I managed to do what I wanted πŸ‘

I had to do a bit of setup.

Eg:

sensors:

pv1_outputpower:
value_template: "{{ (states.sensor['92000ssn18xxxx'].state | float) | round(2) /1000 }}"
unit_of_measurement: 'kW'
friendly_name: "PV1 Power Generation Now"
pv2_outputpower:
value_template: "{{ (states.sensor['52000ssx202xxxx'].state | float) | round(2) /1000 }}"
unit_of_measurement: 'kW'
friendly_name: "PV2 Power Generation Now"
pv1_outputpowertoday:
value_template: "{{ (states.sensor['92000ssn18xxxx'].attributes.eday | float) | round(2)}}"
unit_of_measurement: 'kWh'
friendly_name: "PV1 Power Generation today"
pv2_outputpowertoday:
value_template: "{{ (states.sensor['52000ssx202xxxx'].attributes.eday | float ) | round(2)}}"
unit_of_measurement: 'kWh'
friendly_name: "Power Generation today"

Automation (the sensors were not updating for some reason)

alias: update pvsystem
description: ''
trigger:

  • minutes: /1
    platform: time_pattern
    condition: []
    action:
  • data: {}
    entity_id: sensor.pv1_outputpowertoday
    service: homeassistant.update_entity
  • data: {}
    entity_id: sensor.pv2_outputpowertoday
    service: homeassistant.update_entity
  • data: {}
    entity_id: sensor.pv2_outputpower
    service: homeassistant.update_entity
  • data: {}
    entity_id: sensor.pv1_outputpower
    service: homeassistant.update_entity

Result: (Grafana)

image

from goodwe-sems-home-assistant.

wishie avatar wishie commented on August 10, 2024

@spaya1 do you have any batteries? I have found SEMSPortal to make a complete mess of the data when using 2 inverters in 1 plant.. I ended up splitting mine into 2 separate plants.

from goodwe-sems-home-assistant.

wishie avatar wishie commented on August 10, 2024

@TimSoethout do I need to manually change any files to include 'sems2' in the config etc still, or can I just provide a list of stationids in the sems config?

from goodwe-sems-home-assistant.

spaya1 avatar spaya1 commented on August 10, 2024

Hi @TimSoethout hope you are fine. I am hoping you can help me. As of yesterday and with the new update of home assistant, custom components where Hassio detects I/O inside the event loop errors mean that the component gets disabled. Updating to the latest version of your component means I lose the access to the second inverter (I get the SEMS Portal sensor pointing to the first inverter of the plant). I was wondering if you could help me regain the functionality you once created for me.

thanks!

from goodwe-sems-home-assistant.

spaya1 avatar spaya1 commented on August 10, 2024

@spaya1 do you have any batteries? I have found SEMSPortal to make a complete mess of the data when using 2 inverters in 1 plant.. I ended up splitting mine into 2 separate plants.

Hi, sorry I missed your message, I dont have any batteries, and for some reason for me it works (worked) well. I had the same data in Sems portal as in Hassio, as well as being able to breakdown the data per inverter in the plant.

from goodwe-sems-home-assistant.

TimSoethout avatar TimSoethout commented on August 10, 2024

Hi, I was writing an async version of the plugin a while back. This might also fix the I/O in event loop issue you're describing.
If I have time, I will try look at it tonight.

from goodwe-sems-home-assistant.

spaya1 avatar spaya1 commented on August 10, 2024

Hi, I was writing an async version of the plugin a while back. This might also fix the I/O in event loop issue you're describing.
If I have time, I will try look at it tonight.

That would be great, let me know if I can help!

from goodwe-sems-home-assistant.

TimSoethout avatar TimSoethout commented on August 10, 2024

So, I was trying to work on this tonight, but it already took my whole evening just setting up a hass development environment (using VSCode and docker). Also I'm not sure how I can easily embed this repo in this environment since the docker setup does not seem to support symlinks.
This might take a bit longer than expected...

from goodwe-sems-home-assistant.

spaya1 avatar spaya1 commented on August 10, 2024

Sorry to hear, I do have my hassio on a docker environment in the rbpi4 let me know if you need me to test something.

Thanks again.

from goodwe-sems-home-assistant.

TimSoethout avatar TimSoethout commented on August 10, 2024

from goodwe-sems-home-assistant.

TimSoethout avatar TimSoethout commented on August 10, 2024

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.

from goodwe-sems-home-assistant.

spaya1 avatar spaya1 commented on August 10, 2024

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

from goodwe-sems-home-assistant.

TimSoethout avatar TimSoethout commented on August 10, 2024

from goodwe-sems-home-assistant.

spaya1 avatar spaya1 commented on August 10, 2024

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

from goodwe-sems-home-assistant.

TimSoethout avatar TimSoethout commented on August 10, 2024

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.

from goodwe-sems-home-assistant.

spaya1 avatar spaya1 commented on August 10, 2024

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'

from goodwe-sems-home-assistant.

TimSoethout avatar TimSoethout commented on August 10, 2024

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?

from goodwe-sems-home-assistant.

spaya1 avatar spaya1 commented on August 10, 2024

Hi Tim,

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

image

from goodwe-sems-home-assistant.

TimSoethout avatar TimSoethout commented on August 10, 2024

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?

from goodwe-sems-home-assistant.

spaya1 avatar spaya1 commented on August 10, 2024

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

from goodwe-sems-home-assistant.

spaya1 avatar spaya1 commented on August 10, 2024

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?

from goodwe-sems-home-assistant.

TimSoethout avatar TimSoethout commented on August 10, 2024

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

from goodwe-sems-home-assistant.

spaya1 avatar spaya1 commented on August 10, 2024

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.

from goodwe-sems-home-assistant.

TimSoethout avatar TimSoethout commented on August 10, 2024

from goodwe-sems-home-assistant.

spaya1 avatar spaya1 commented on August 10, 2024

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 :)

from goodwe-sems-home-assistant.

TimSoethout avatar TimSoethout commented on August 10, 2024

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?

from goodwe-sems-home-assistant.

spaya1 avatar spaya1 commented on August 10, 2024

"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,

from goodwe-sems-home-assistant.

TimSoethout avatar TimSoethout commented on August 10, 2024

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.

from goodwe-sems-home-assistant.

spaya1 avatar spaya1 commented on August 10, 2024

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

from goodwe-sems-home-assistant.

spaya1 avatar spaya1 commented on August 10, 2024

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?

from goodwe-sems-home-assistant.

TimSoethout avatar TimSoethout commented on August 10, 2024

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.

from goodwe-sems-home-assistant.

TimSoethout avatar TimSoethout commented on August 10, 2024

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

from goodwe-sems-home-assistant.

spaya1 avatar spaya1 commented on August 10, 2024

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

from goodwe-sems-home-assistant.

TimSoethout avatar TimSoethout commented on August 10, 2024
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.

from goodwe-sems-home-assistant.

spaya1 avatar spaya1 commented on August 10, 2024

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!

from goodwe-sems-home-assistant.

TimSoethout avatar TimSoethout commented on August 10, 2024

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

Thanks for the debugging/testing support @spaya1.

from goodwe-sems-home-assistant.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.