StephanJoubert / home_assistant_solarman

Home Assistant component for Solarman collectors used with a variety of inverters.
Apache License 2.0
544 stars 199 forks source link

SofarSolar unknown data in entities #18

Closed kion666 closed 2 years ago

kion666 commented 2 years ago

Hi @StephanJoubert and thanks for this nice integration. I have an SofarSolar and it looks very similar as DEYE. It is now connected to solarman. But I have some problems with integration in HA. All the data are unknown

image

image

Can You support me in that case? Thanks in advance

StephanJoubert commented 2 years ago

Hi @kion666 . I have lookes at Sofar, and it is indeed very similar. The parameters and IDs for parameters are however quite different. The good news is that the parameters are quite well known and this integration can cater for that. I am planning to create a parameters.yaml file for sofar, but since I can't test you can maybe test and fine tune. Once it works you can just update (or send to me to update) the repo.

Will let you know once the initial file is there and you can try.

StephanJoubert commented 2 years ago

I have created a yaml file from the data I have. It was not possible to test at all so please expect problems :) See attached zipfile.

To test.

  1. Make a copy of parameters.yaml in the custom_components/solarman folder
  2. Overwrite parameters.yaml with the file parameters_sofar.yaml. (Rename parameters_sofar.yaml to parameters.yaml)
  3. See if you get any success, and if so, which parameters need tweaking.

I include the file I used as source to get the parameter definition SOFARMap.txt and the yaml file generated from it that you can use as starting point.

lookup_files.zip

kion666 commented 2 years ago

Thank you very much Stephan. I will try to test it tomorrow morning (now my child's are going sleep) and of course I will let you know. I really appreciate your help. PS. I just replace the the file. So I will sleep with crossed fingers :) Have a good night

kion666 commented 2 years ago

Hi @StephanJoubert. I just checked HA and I can see that some of the data are not correct like daily and total production. I checked the paramaters.yaml and SofarMAE.txt and it looks like the registers are the same. Some of entities are not neccesary in my inverter, but I cane remove them myself :) But I don't now what to do with wrong daily, total production and time. Other parameters are shown correctly like power/voltage. image

Thanks in advance.

grzegorz189 commented 2 years ago
kion666 commented 2 years ago

Thank You very much @grzegorz189 image

Do You have any clue about Daily Production?

grzegorz189 commented 2 years ago
Zrzut ekranu 2022-02-10 144157
grzegorz189 commented 2 years ago

requests:

parameters:

kion666 commented 2 years ago

Thanks a lot @grzegorz189 Works like a charm 👍 image

What entity did You connect with Energy module? And also can You provide this file in some more useful format?

StephanJoubert commented 2 years ago

Hi @kion666 , @grzegorz189 , Just to let you know that I have added the ability to specify the lookup file in the configuration, and also included a sofar_lsw3.yaml file based on the file above. If you pull the latest from the repo you should be able to check.

I have not published a release that will be picked up by HACS since I was afraid it will overwrite the settings you already have.

Also, have a look at the "state_class" added to parameters.yaml and please update "sofar_lsw3" likewise. It is especially useful for the energy dashboard. If you are happy with the file,just create a pull request with the updated file and I will merge it into the main branch.

grzegorz189 commented 2 years ago

Very good idea, "state_class" - ok, I still have a problem with showing the status of history, you can take a look at it Przechwytywanie Thanks

grzegorz189 commented 2 years ago

I have one more problem after restarting home assistant and when the inverter is turned off, most often at night, all entities are unknown Przechwytywanie

kion666 commented 2 years ago

Hi @StephanJoubert and @grzegorz189 I will try to check the new config for sofar tomorrow and I will let you know. Thanks for update state class. Now I have to manually add this to daily and totally production. It will be easier to configure. Best regards

StephanJoubert commented 2 years ago

@grzegorz189 Yea the entities will do that if home assistant is restarted while the inverter was offline. However, if the entities has values and the inverter goes offline, the values will be maintained.

If you want to use these in automations and it presents a problem, you should be able to look at the status_connection or status_lastUpdate to determine if the values can be used.

kion666 commented 2 years ago

Hi once again @StephanJoubert I confirm that after added sofar yaml to configuration.yaml some of the entities ar unavailable. However the most important for me as daily production, Power, Voltage are working ok.

image

Thank You very much for your help.

kion666 commented 2 years ago

Also @StephanJoubert I can see that energy module is not working correctly. So I need to revert back

sensor.sofar_daily_production:
        state_class: total_increasing

Thank You once again.

binoke commented 2 years ago

I have a 3Phase invertor (Sofar HYD 10KTL-3PH-A). I have tested the code and integration in HA. I see that the connection to my invertor works, but the values are unknown or Unavailable. Would it be possible to create a parameters file for my invertor. I'm happy to do myself but my modbus knowledge is non-existing.

kion666 commented 2 years ago

@binoke Did You add the sofar_lsw3.yaml to Your config and do You have this file in config\custom_components\solarman? I also have the KTL Sofar and most important entities are working correctly for me.

binoke commented 2 years ago

@kion666 What I did was as listed in the original discription:

so when I look at the sensor. I see it's connected and updating image image

but all other sensor values are Unknown or Unavailable.

kion666 commented 2 years ago

I just set the lookup file as: image

And downloaded all repo to solarman: image

cityslicker99 commented 2 years ago

Hi does this help? SOFARSOLAR ModBus-RTU Communication Protocol (1).pdf p

StephanJoubert commented 2 years ago

Hi @kion666 , that is correct. You can now edit the sofar_lsw3 file to get it working as expected.

kion666 commented 2 years ago

Thanks once again @StephanJoubert I close the issue and going to buy you coffee :)