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
Comments
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. |
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. |
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 |
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: 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:
I have not tested this, but it just might work. |
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:
I dont have yet the second inverter, so I have copied the same station id twice. I get two errors: Error 1: Error while setting up sems2 platform for sensor Error2: Unable to fetch data from SEMS. 'NoneType' object is not subscriptable |
Maybe you need to change https://github.com/TimSoethout/goodwe-sems-home-assistant/blob/master/custom_components/sems/manifest.json also to |
Hi Tim, i did change it before restarting HA. |
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/ |
Hi Tim, It seems that sems2 is working now but sems is not :) I added this: logger: I am getting this new error: Logger: custom_components.sems.sensor Unable to fetch data from SEMS. HTTPSConnectionPool(host='www.semsportal.com', port=443): Read timed out. (read timeout=30) |
You can add It seems that the api does not like 2 requests (for the same inverter) at the same time maybe? |
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 Error while setting up sems2 platform for sensor Error 2: Logger: custom_components.sems2.sensor 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. |
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 |
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 :) |
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. |
That makes sense, because we only add the values of the first inverter: 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.
The first seems more proper, but also harder to implement if we don't want to do multiple API request per plant. |
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"] |
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? |
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. |
They should have diffeerent names. If you enable debug logging you should see something like this in the logs: |
Hi Tim, I must be doing wrong, I have set it up under sems3, and this is my config:
logger: 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 |
nvm my logger was wrongly configured... 2020-05-29 08:28:57 DEBUG (SyncWorker_6) [custom_components.sems3.sensor] REST Response Recieved This is the only one it finds |
You should see something like this:
(maybe with 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 |
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_ 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) 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 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 |
I have to fix those IO warnings still, but they should not keep it from working. 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). |
A new reboot, and they show up :) Are these names end state? Then I can start building my sensors around them :) Thanks!! 👍 |
Nice. Probably I will make the names something like
sems_{plantName}_{inverterName}.
Does that make sense?
…On Fri, May 29, 2020, 09:33 spaya1 ***@***.***> wrote:
A new reboot, and they show up :)
Are these names end state? Then I can start building my sensors around
them :)
Thanks!! 👍
—
You are receiving this because you modified the open/close state.
Reply to this email directly, view it on GitHub
<#10 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAEQZ3G4U46RU3JG2C2KJUDRT5QN3ANCNFSM4JQ6HYBA>
.
|
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: but shows Error rendering template: TemplateSyntaxError: expected token 'end of print statement', got 'ssn18bwXXXX' |
I don't know why that doesn't work, this seems to work: My gut feeling says that python does not like names/variables to start with a number. |
Yes thanks.
I was trying to set up a proper development setup (separate from my
home/production system) using
https://developers.home-assistant.io/docs/development_environment. Turns
out a lot of things can be wrong and need to be setup before you can
actually start coding. :P
…On Wed, 14 Apr 2021 at 08:54, spaya1 ***@***.***> wrote:
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.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#10 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAEQZ3F4TLFBXXUJKNMXSM3TIU3ZTANCNFSM4JQ6HYBA>
.
|
Ok, I just finished a working version of this on branch #10-multiple-inverters+async. |
Hi Tim, thanks for the work, I loaded the branch, and I get the following error: Logger: homeassistant.components.sensor 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):
|
It now uses gui config via integrations. I think you need to remove
existing config, and maybe keep only `sems:` to make sure HA picks up the
custom component.
…On Wed, Apr 14, 2021, 17:49 spaya1 ***@***.***> wrote:
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.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#10 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAEQZ3AUUHF3MVPRHZQWGBDTIW2PDANCNFSM4JQ6HYBA>
.
|
Hi Tim, What I get: Setup failed for sems: No setup or config entry setup function defined. Logger: homeassistant.setup Setup failed for sems: No setup or config entry setup function defined. I have also restored the manifest to sems |
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. this used to be my calculation: |
|
You indeed have the correct code, since you have the config_flow file and translations folder... Hmm.. Not sure what is happening. Is the Can you try removing all of |
Will try now, but I never had the sems_portal sensor before. |
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 |
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. |
Ooooh wait. The `powerstation_id` is the plant id? And not the specific
inverter ID?
If that is so, I need to change the code. :P
…On Wed, 14 Apr 2021 at 21:37, spaya1 ***@***.***> wrote:
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.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#10 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAEQZ3D6VTVIJQHTQ67DTRTTIXVHFANCNFSM4JQ6HYBA>
.
|
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 :) |
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? |
"releation_id": "147cb869-xxx",
"releation_id": "50e0e175-xxx", "invert_full": { |
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? |
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 About the |
Thanks for all the feedback @spaya1 . If this one works, I'll promote it to the new normal version. |
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 👍 I owe you some bitterballen! |
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 Error fetching SEMS API data: Error communicating with API: 'NoneType' object is not iterableLogger: custom_components.sems.sems_api 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 Unable to fetch data from SEMS. 'NoneType' object has no attribute 'requestTimestamp |
I get some of these with the new beta version. 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. |
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! |
How to get data from second inverter?
The text was updated successfully, but these errors were encountered: