Code Monkey home page Code Monkey logo

sajesolar's People

Contributors

confushion avatar djansen1987 avatar faanskit avatar krahabb avatar robshot avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

sajesolar's Issues

esolar nowPower En esolar todayElectricity

De esolar nowPower blijft de volgende ochtend op 0 staan na herstart Home assistent werkt het weer.

in energie heb ik esolar todayElectricity ingesteld bij de zonnepanelen
De waarde is de volgende dag niet 0 en ik denk dat ie bij -10 of iets anders
begint en gaat verder met optellen. Na herstart Home assistent telt de waarde af. Dit is alleen bij energie overzicht van Home Assistant

omvormer gaat als de zon onder is uit en in de ochtend zelf weer aan

E49912BD-AAB3-4385-B1EE-6655D67A9CBD
A6D46333-029E-4497-8280-38968998D4ED
717940F9-A95D-40AD-ABDF-4DC8C50841C9

unit_of_measurement

Logger: homeassistant.components.sensor
Source: components/sensor/init.py:151
Integration: Sensor (documentation, issues)
First occurred: 21:58:16 (15 occurrences)
Last logged: 21:58:19

custom_components.saj_esolar.sensor is setting 'unit_of_measurement' on an instance of SensorEntityDescription, this is not valid and will be unsupported from Home Assistant 2021.11. Please report it to the custom component author.

"return data NONE" occurs many time recurrent in HA log

Home Assistant log get's filled with 100's, 1000's error occurences :

see event below which occured 108 times on maybe 1 or 2 minutes :

Logger: custom_components.saj_esolar.sensor
Source: custom_components/saj_esolar/sensor.py:797
Integration: saj_esolar (documentation, issues)
First occurred: 20:46:39 (108 occurrences)
Last logged: 20:49:09
return data NONE

also got the following 1 time :

Logger: custom_components.saj_esolar.sensor
Source: custom_components/saj_esolar/sensor.py:768
Integration: saj_esolar (documentation, issues)
First occurred: 20:48:39 (1 occurrences)
Last logged: 20:48:39
Unknown error occurred while polling eSolar: Session is closed

I just activated the debug log on HA and will check what it says over there.

Current House Load Power

Hi again @djansen1987,
Hoping to continue assisting with anything I'm finding from my end. I've noted I can't see a 'Current Home Load/Power' statistic to read how much the home is using throughout the day.

homeloadpower

a few unrelated finds;
sensor.esolar_solarpower should also have the suffix kWp.

sensor.esolar_gridpower doesn't seem to know if it's importing power or exporting power (in Watts). In either direction it reads as a positive number either way.

sensor.esolar_batterydirection has a number as a value, I've found -1 is Charging from PV, 1 means Discharging to home, 0 means standby/not currently being used. Can the value it outputs be changed to 'CHARGING / DISCHARGING / STANDBY' ?

Thanks mate! Love your work

Alarm number not being retrieved

Hi!

I noticed today that the alarm count for my H1 inverter has been set as unknown for a few hours.

Everything else seems to be working fine.

Thanks!

pvElec and useElec mulitplied by 1000?

Hi there!

I've been tracking my SAJ solar panels for some time now using this HA plugin, and I'm very thankful for it!

Today something happened... is it just for me? My pvElec and useElec sensors seem to have switched from kWh to Wh. To make this clear:

  • previously, mid-morning I'd have seen something like pvElec = 2.5kWh because the plugin returns "2.5" and I set HA to use kWh as the unit -- consistent with all other sensors
  • today I see a massive jump as my mid-morning production is pvElec = 2.5MWh - the plugin is returning "2500" and HA still considers that to be kWh
  • some other related sensors (buyElec, sellElec) are still fine and correctly in the "single-digit kWh" range
  • no change / incident is visible when using the SAJ web app, though I can't know that they didn't change conventions behind the scenes

Obviously if I now change the unit to Wh instead of kWh I'll get the right value, but the history is going to be affected (the unit affects all previous readings), and it won't be as consistent with other sensors.

My inverter is a SAJ R5-2K-S1-15.

EDIT: it's actually not a scale issue but a "base bump" one. It looks like those counters have jumped to 2.490 kWh this morning, and are now progressing "normally" on top of this base level.

Cheers,
Pierric.

newbie

Hi
I have just instaled a new SAJ h1 series in my home and i am trying to integrate in home assinstant with no luck.
I have a meter but i dont think i have a sec module.
After the configuration al the sensors have the state as unkown.
Can you help me?
Many thanks

eSolar SEC Module Issue

Hi @djansen1987

Greetings,

I'm still see issue on data provided for sensor.esolar_totalloadpower , sensor.esolar_totalgridpower & sensor.esolar_totalpvgenpower.

Here example data from HA
Screenshot 2021-09-04 at 4 26 28 PM

This from App SAJ

IMAGE 2021-09-04 16:31:40

Sometime PV generation data seem swapped with Grid output data. Not sure why this happen, can you look up on this?

Thank you.

Peakpower not showing

I just updated this HA addon. I needed to remove the todayAlarmNum for it to work again. Though I notice that peakPower is not updating anymore and is showing as unknown right now. I have not removed that entry from the yaml.
Is this a known issue and is there a way to fix this on my end?

All data lose -New platform migrate.

Hello,
I have been using this software for over a year without any problems.
Today, December 8th, I lost all the information I was collecting without any prior warning.
I thought my HA was corrupted, and pulled the backup. Same result, I don't see the battery, I don't see any information from the SAJ portal.
Looking at the manufacturer's app, everything is OK. Finally, I connect to the SAJ portal and I don't see my inverter or any data. I see that there is a switch to a "new platform", I enter that platform and there is all the information.
I already understood that it happened. They have migrated my plant to the new portal, without warning.
I imagine it's happening to all users. And those of us who depend on HA are now blind. In my case, I need to know the battery charge to decide if I should connect the inverter to the grid, since I am usually not connected to it.
Do you know if there is a way to fix this quickly? If it had happened in the middle of summer, I wouldn't worry too much, but at this time, I need to be aware of how the battery is doing.

Thanks.

Add Information eSolar SEC Module

Hi,

I've eSolar SEC Module, can you add/capture data from eSolar SEC Module from fop.saj-electric.com?

This module can capture all this data as below :-

  • Daily Load Energy
  • Today Import Energy
  • Total Pv Generation Energy
  • Total Load Energy
  • Total Import Energy
  • Total Export Energy
  • Total Pv Generation Consumption Energy
  • Total Grid Power
  • Total Grid Reactive Power
  • Phase 1/2/3 Grid Voltage
  • Phase 1/2/3 Grid Current
  • Phase 1/2/3 Grid Frequency
  • Phase 1/2/3 Grid Power
  • Phase 1/2/3 Grid Power Factor
  • Total Load Power
  • Module Signal

This data is updated every 5 minutes on fop.saj-electric.com.

Much appreciate if you can included this information on this SAJeSolar.

Thanks

uitlezen SAJ converter

Hoi,

Ik heb een R5-12K-T2 SAJ omvormer met Aio3 module (met een Ethernet connectie in mijn router). Op de eSolar Portal kan ik inloggen en alle log gegevens bekijken.

Is het mogelijk om dit te integreren in Home Assistant ? Mij is niet helemaal duidelijk of dit nu wel of niet mogelijk is met deze integratie in HA.

Alvast dank.

Lettura non riuscita Aiuto!

Ciao sono Nuovo.
ho seguito tutto passo passo per un inverter AS1-3kS-20.4
ma non leggo proprio tutto.
Qualcuno potrebbe darmi una mano?
image
image

Home Battery Storage (Energy Integration)

Hi Mate,
Thank you for the new updates. Your work is incredible. Happy to keep assisting in any way I can.

The final enhancement could be under the Energy Dashboard. The Home Battery Storage section allows to monitor battery Input & Output.

Screenshot 2022-01-15 090120

Output via "sensor.esolar_batterypower" can't be selected.
I don't beleive we've found a method to read the input (yet...) I'll do some research and see if I can find something and report back

is fop.saj-electric.com deprecated?

I noticed that the integration was not working anymore for me. I accessed the esolar site and noticed that
-My plant was gone. no more data
-There is a button "new platform" taking me to https://esaj-home.saj-electric.com/index. That new site does shows my data.

Did anyone else experienced this?

A bit more info...

My R5 inversor and esolar module are rebranded with the "Greenheiss" brand (for Spain market). Their version of esolar (which is basically a reskin of SAJ's) still shows my plant https://inversores-style.greenheiss.com/cloud. if anyone's elses integration got killed it might be worth to check that domain.

My guess is they are deprecating the fop site but left Greenheiss users in the old one?

in any case, the integration is probably not working anymore for greenheiss users (and probably others rebranded units ) unless we point to their domain (maybe it can be configured? I'll try to check).

Error

Hola, soy un nuevo usuario de HA y Saj Solar, y quiero implementar tu trabajo pero me encuentro con varios errores y no se seguir con el trabajo
re

IMPROVEMENT: Grid Voltage/Current/Frequency

The WEB portal for eSolar does not provide the Grid information via its API. However, the APP utilized other API's from which additional information can be obtain.

The app does not use session cookies, but a token and userUid is required. To obtain the token, login with this endpoint and the password hashed with MD5.

        BASE_URL = "https://fopapp.saj-electric.com/sajAppApi/api"
        USER = "usename"
        PASSWORD= "password"
        response = requests.post(BASE_URL + "/oppersonal/login4C", data = {
            "appProjectName": "fop4lite",
            "appVersion": "1.5.0",
            "clientDate": today.strftime('%Y-%m-%d'),
            "lang": "en",
            "language": "en",
            "loginName": USER,
            "password": hashlib.md5(PASSWORD.encode()).hexdigest(),
            "platform": "iOS",
        }, timeout=5)

        _G["token"] = response.json().get("token")
        _G["userUid"] = response.json().get("bean").get("userId")

To obtain additional data, use this request. Take note that DeviceSN was already fetched with /getPlantDetailChart2 or /getPlantDetailInfo

        response = requests.post(BASE_URL + "/device/getDeviceRunInfoV2", data = {
            "appProjectName": "fop4lite",
            "appVersion": "1.5.0",
            "clientDate": today.strftime('%Y-%m-%d'),
            "deviceSN": _G["DeviceSN"],
            "lang": "en",
            "language": "en",
            "localDate": today.strftime('%Y-%m-%d'),
            "passKey": _G["userUid"],
            "platform": "iOS",
            "token": _G["token"],
        }, timeout=5)

This will produce the following output:

{
    "error_code": "0",
    "error_msg": "0",
    "data": {
        "pV1Volt": "573.1",
        "pV1Curr": "0.83",
        "pV2Volt": "582.6",
        "pV2Curr": "0.8",
        "pV3Volt": "N/A",
        "pV1StrCurr1": "N/A",
        "pV1StrCurr2": "N/A",
        "pV1StrCurr3": "N/A",
        "pV1StrCurr4": "N/A",
        "pV2StrCurr1": "N/A",
        "pV2StrCurr2": "N/A",
        "pV2StrCurr3": "N/A",
        "pV2StrCurr4": "N/A",
        "pV3StrCurr1": "N/A",
        "pV3StrCurr2": "N/A",
        "pV3StrCurr3": "N/A",
        "pV3StrCurr4": "N/A",
        "rGridVolt": "237.1",
        "rGridCurr": "1.54",
        "rGridFreq": "49.96",
        "sGridVolt": "238.4",
        "sGridCurr": "1.56",
        "sGridFreq": "49.96",
        "tGridVolt": "236.9",
        "tGridCurr": "1.56",
        "tGridFreq": "49.96",
        "runStatus": 1,
        "updateTime": "2022-06-19 09:20:00",
        "isAS1": 0,
        "pvList": [{
                "deviceType": 0,
                "pvVolt": "573.1",
                "pvCurr": "0.83",
                "strCurr": ["N/A", "N/A", "N/A", "N/A"],
                "pvPower": "N/A"
            }, {
                "deviceType": 0,
                "pvVolt": "582.6",
                "pvCurr": "0.8",
                "strCurr": ["N/A", "N/A", "N/A", "N/A"],
                "pvPower": "N/A"
            }, {
                "deviceType": 0,
                "pvVolt": "N/A",
                "pvCurr": "N/A",
                "strCurr": ["N/A", "N/A", "N/A", "N/A"],
                "pvPower": "N/A"
            }
        ]
    }
}

r/s/t GridVolt,GridCurr,Freq corresponds to the Grid output for the tree different phases.

The following endpoints used by the APP are fairly straight forward, but mostly redundant from the ones used by the portal and this integration:

POST https://fopapp.saj-electric.com/sajAppApi/api/oppersonal/login4C
POST https://fopapp.saj-electric.com/sajAppApi/api/opSettings/getData
POST https://fopapp.saj-electric.com/sajAppApi/api/bindingDeviceToken
POST https://fopapp.saj-electric.com/sajAppApi/api/GetNewVersionInfo
POST https://fopapp.saj-electric.com/sajAppApi/api/getInverters3
POST https://fopapp.saj-electric.com/sajAppApi/api/4.0/plant/getPlantAlarmNum
POST https://fopapp.saj-electric.com/sajAppApi/api/device/getDeviceBaseInfo
POST https://fopapp.saj-electric.com/sajAppApi/api/device/getDeviceRunInfoV2

The following endpoints used by the APP still needs to be figured out:

POST https://fopapp.saj-electric.com/sajAppApi/api/plant/plantPreviewListV5
POST https://fopapp.saj-electric.com/sajAppApi/api/plant/plantHomeDetail4Air
POST https://fopapp.saj-electric.com/sajAppApi/api/plant/getChartDeviceAndYearInfo
POST https://fopapp.saj-electric.com/sajAppApi/api/plant/getChartData

They appear to be using a SHA1 to create the signature, but I cannot reproduce it. Likely some salt is added by the app. I am clueless wrt. to reverse engineering apps, so I'm not sure I'll succeed. The app seems to be written in Kotlin, which makes it even harder to figure out (for me at least).

signParams:     appVersion,clientDate,lang,pageNo,pageSize,passKey,platform,timeStamp,token
signature:      B619F120519488AD00A0C760546038356ABD69D9

If my time allows, I'll add the code a provide it as a pull request. For now, I just wanted to offer my findings for anyone to pick up.

rename of resources and historical dashboard data

Maby this is not the right place to ask, please tell me if so.

If i remember correctly renaming of entity_id or names (wich renaming the resources with last update(?)) used in a running/used dashboard means the loss of historical data of the entire dashboard and the sensor data of all sensors specified in the dashboard.

Will that be the case if i update to version 1.0.0.4 or later from version 1.0.0.3?

Integration is using deprecated `DEVICE_CLASS_*` constants

This custom integration uses deprecated DEVICE_CLASS_* constants in its codebase.

The DEVICE_CLASS_* constants have been deprecated and replaced in Home Assistant Core 2021.12 (over a year ago). I would highly suggest updating/migrating this integration to the new enums.

For example, for the device classes supported by the sensor platform, there is now a SensorDeviceClass enum. So if a sensor previously used the DEVICE_CLASS_ENERGY constant, it should now use SensorDeviceClass.ENERGY. Other platforms (like binary_sensor, and number) provide similar enumerations for their supported device classes.

The migration thus only consists of replacing constants with an enumeration member and is, therefore, very low impact and should be fairly straightforward.

If I can help resolve any questions regarding this change or migration, feel free to ask or respond to this issue. I'm happy to help!

Kindest regards,

../Frenck

Add more states to runningState handling

For what I can see in the code, the state handling is binary: if it's zero it's shown as off, any other value is shown as on. In my case, I see I'm getting the state as 2 and, in the official SAJ portal, I can see the state as red. It doesn't mean it's not working, but there's some error connection in the inverter (a red color isn't a good UX for this case).

imatge
imatge

I'm pretty newbie to homeassistant and, more specifically, to how plugins and sensors are done but, could it be possible to make it non binary? In this case, I'd show a "warning" text for this specific case.

more plants

Hi! Thanks for you work!

I have 2 plants with Saj inverters and AIO3 devices. How can monitor both?

If I specify the plant_id in configuration.yaml, I got this error:

Invalid config for [sensor.saj_esolar]: [plant_id] is an invalid option for [sensor.saj_esolar]. Check: sensor.saj_esolar->plant_id. (See ?, line ?).

If I remove the plant_id key, I get only the first plant. For me more important is the second. How can i monitor this?

Can you help me?

Hi i am totaly new to all this and trying to install this SAJ monitor thing.
I have to copy all those files in a directory, but im not sure where .
Is this the right path?
path naar SAJ

Ik hoop dat je kan helpen.
groetjes, Herman

Battery charging and discharging

It would be great to be able to charge and discharge the battery and control it through home assistant (with an automation for example)

AIO3 supported?

Hi,

Not an issue, but a question. I have a SAJ H1 5K Inverter connected via a AIO3 module. Is this SAJeSolar package compatible with an AIO3 module or not?

Thanks!

what is totalloadpower

Hello,
First of all, thank you for this. it's been very helpful!

Im having trouble understanding what the sensor totalloadpower is. looking at the SAJ portal it seem to indicate the power being drawn by my home (from getPlantMeterEnergyPreviewInfo ) but in HA this seems to be reporting only the self consumed load. e.g. If Im loading 1kw from the grid and 1kw from my panels, I was expecting totalloadpower to report 2kw, but it just reports 1kw.

Is this a bug or or Im just not understanding it's purpose. Which sensor contains the total load being drawn by my home?

Unit of measurement (warning) on sensor

Logger: homeassistant.components.sensor
Source: components/sensor/init.py:158
Integration: Sensor (documentation, issues)
First occurred: December 7, 2021, 11:45:39 PM (1 occurrences)
Last logged: December 7, 2021, 11:45:39 PM

custom_components.saj_esolar.sensor is setting 'unit_of_measurement' on an instance of SensorEntityDescription, this is not valid and will be unsupported from Home Assistant 2021.11. Please report it to the custom component author.

Add uuid param to reduce calls load and allow unpaired users to use the plugin

Today I was migrating home assistant from a docker to a raspberry pi. Something I tried twice before, and had no issues, but today suddenly, after loading the backup in the raspberry pi, I noticed all the esolar sensors weren't working.

After debugging some time, I realized my plant was unlinked from my account in the saj website, but I can still access it via the URL

https://fop.saj-electric.com/saj/monitor/site/detailForm?plantuid={UUID}

I'm aware this plugin can't be the culprit, unless saj website has some serious issue in the used calls, and they unlinked my account when migrating (very unlikely, and remember I tried migrating twice this week without issues).

So I manually hardcoded the UUID in the sensor.py file in order to have it working. I do realize I lost some sensors that were taken from the plant list, but I'm not really using those, so I don't care.

I think you could add a configurable way of adding that UUID, and avoid the response2 entirely in such case (or find other means to get those values, without the plant list requirement). Obviously this should be accompanied with a notice warning about the possible missing sensors, in case you opt for that way.

Multiple Invertors on Account

I have 2 SAJ inverters at my place but the addon only returns the last one added. Is there an extra variable where you can select a specific plant, or select all.

I'd either return both values individually and create a sensor adding them together or get the PLANT TOTAL from the portal if possible.

HA Energy Dashboard: which sensor do I add?

Hi,

I've installed your integration: thanks for it! There is a sensor called "sensor.esolar_nowpower" which gives me the current Power that the Inverter generates. I tried to add this sensor to the HA Energy Dashboard (Solar Panels), but I can't see/select it in the list.

I see:

  • esolar_buyelec
  • esolar_chargeelec
  • esolar_dischargeelec
  • esolar_sellelec
  • esolar_totalbuyelec
  • esolar_totalbuyenergy
  • esolar_totalloadenergy
  • esolar_totalpvenergy
  • esolar_totalsellelec
  • esolar_totalsellenergy
  • esolar_useelec

But none of them gives me the "current power" that I want to use in the Energy Dashboard. What am I missing or what am I doing wrong?

Thanks (a HA noob)!

AS1-3KS-5.1 (Untested)

Hello @djansen1987,
Thank you for your amazing work! I've got the untested SAJ AS1-3KS-5.1 5,1kWh battery (I beleive these got rebranded as an Eveready Energy Vault) and would be happy to contribute in any way I can to this project.

Its paired with a R5-5K-S2 Inverter and (from what I can tell) the WiFi-D data collector.

So far I've got the saj_esolar portion of your project working great, but can't seem to pull anything from the Battery or self consume rates. Happy to test/assist just let me know

supported devices: Greenheiss inverter GH-I

Hello,
Recently I had my solar installation done. I got an inverter "Greenheiss GH-I 2M STYLE". While investigating on it and how to read from it I discovered it is just a rebranded SAJ R5 inverter for the spanish market.
Actually, my credentials from the monitoring site (http://inversores-style.greenheiss.com ) work perfectly in the SAJ esolar portal.
I installed this addone through HACS and I can report it works fine so far.

I think it would be useful to mention this. I cannot confirm for the other models but at least mine works fine.

Battery temperature sensor

H1 with batteries you can get the average battery temperature.

Will make a pull request soon. I have this working.

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.