djansen1987 / sajesolar Goto Github PK
View Code? Open in Web Editor NEWSAJ eSolar Portal Sensors
License: GNU General Public License v3.0
SAJ eSolar Portal Sensors
License: GNU General Public License v3.0
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).
Tryin to include SAJ Solar panel in HASS and getting errors.
Registrador: homeassistant.setup
Fuente: setup.py:349
Ocurrió por primera vez: 12:12:11 (1 ocurrencias)
Último inicio de sesión: 12:12:11
The 'saj_esolar' integration does not support YAML setup, please remove it from your configuration
Registrador: homeassistant.setup
Fuente: setup.py:269
Ocurrió por primera vez: 12:12:11 (1 ocurrencias)
Último inicio de sesión: 12:12:11
Setup failed for custom integration 'saj_esolar': No setup or config entry setup function defined.
I have a GH-I 8.0 2M STYLE
Thanks for the help
A
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.
Hi @djansen1987
Greetings,
I'm still see issue on data provided for sensor.esolar_totalloadpower , sensor.esolar_totalgridpower & sensor.esolar_totalpvgenpower.
This from App SAJ
Sometime PV generation data seem swapped with Grid output data. Not sure why this happen, can you look up on this?
Thank you.
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
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.
In Late December 2023, SAJ changed their portal server, there are now several regional severs.
How do I change the server used from https://fop.saj-electric.com/ to https://intop.saj-electric.com/saj. This is the international Server.
Additionally the Plant ID is now a 6 character ASCII string which fails the configuration check.
Thanks
David
In the evening, when the sun is gone, I first get the ERROR:
2024-04-11 21:07:05.212 ERROR (MainThread) [custom_components.saj_esolar.sensor] Unknown error occurred while polling eSolar: 'plantDetail'
followed by a long list with the following error:
2024-04-11 21:07:05.221 ERROR (MainThread) [custom_components.saj_esolar.sensor] return data NONE
2024-04-11 21:07:34.922 ERROR (MainThread) [custom_components.saj_esolar.sensor] return data NONE
2024-04-11 21:07:34.923 ERROR (MainThread) [custom_components.saj_esolar.sensor] return data NONE
2024-04-11 21:07:34.923 ERROR (MainThread) [custom_components.saj_esolar.sensor] return data NONE
2024-04-11 21:07:34.924 ERROR (MainThread) [custom_components.saj_esolar.sensor] return data NONE
..
..
2024-04-11 21:12:04.945 ERROR (MainThread) [custom_components.saj_esolar.sensor] return data NONE
2024-04-11 21:12:04.946 ERROR (MainThread) [custom_components.saj_esolar.sensor] return data NONE
2024-04-12 02:50:21.859 ERROR (MainThread) [homeassistant] Error doing job: Task was destroyed but it is pending!
This lasts exactly 5 minutes, then it stops.
Is their a way to avoid this error?
brgds,
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.
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 :-
This data is updated every 5 minutes on fop.saj-electric.com.
Much appreciate if you can included this information on this SAJeSolar.
Thanks
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!
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:
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.
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).
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.
Hi,
Just wanted to report HA told me this today when restarting the container:
2024-02-14T12:08:28.797946052Z 2024-02-14 13:08:28.795 WARNING (MainThread) [homeassistant.const] ENERGY_KILO_WATT_HOUR was used from saj_esolar, this is a deprecated constant which will be removed in HA Core 2025.1. Use UnitOfEnergy.KILO_WATT_HOUR instead, please create a bug report at https://github.com/djansen1987/SAJeSolar/issues
2024-02-14T12:08:28.819433336Z 2024-02-14 13:08:28.810 WARNING (MainThread) [homeassistant.const] POWER_WATT was used from saj_esolar, this is a deprecated constant which will be removed in HA Core 2025.1. Use UnitOfPower.WATT instead, please create a bug report at https://github.com/djansen1987/SAJeSolar/issues
So I thought I'd be a good citizen and open this issue (haven't seen any other references to this)
Unrelated, renaming sensors to better understand what they are. Found a couple of items that missed having a suffix after the value ;)
sensor.esolar_totalconsumpelec - kWh
sensor.esolar_batcapcity - Ah
sensor.esolar_batenergypercent - %
sensor.esolar_gridpower - W
Originally posted by @BeardyBrah in #16 (comment)
Hi,
I want to check is if R6 Series Inverter is supported on this integration?
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.
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.
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
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?
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
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?
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:
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)!
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?
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.
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?
I need help i install solar system saj h1-6k-s3 inverte and use 👍
nowPower
runningState
todayElectricity
monthElectricity
yearElectricity
totalElectricity # Energy -> Solar production
lastUploadTime
totalPlantTreeNum
totalReduceCo2
status
plantuid
currency
address
isOnline
devOnlineNum
selfUseRate
totalBuyElec # Energy -> Grid consumption
totalConsumpElec
totalSellElec # Energy -> Return to grid
chargeElec # Energy -> Home Battery Storage -> Energy going in to the battery (kWh)
dischargeElec # Energy -> Home Battery Storage -> Energy coming out of the battery (kWh)
pvElec
useElec
buyElec
sellElec
buyRate
sellRate
selfConsumedRate1
selfConsumedRate2
selfConsumedEnergy1
selfConsumedEnergy2
batCapcity
batCurr
batEnergyPercent
batteryDirection
batteryPower
gridDirection
gridPower
h1Online
outPower
outPutDirection
pvDirection
pvPower
solarPower
totalLoadPower
i cant see nothing
Hi @djansen1987
Greetings,
Today Home Assistant release new update with new Energy Dashboard features
Here : https://www.home-assistant.io/blog/2021/08/04/home-energy-management/
Maybe you can integrate this to Energy Dashboard with SAJeSolar.
Thank you and have a nice day!
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.
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.
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
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.
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!
Do you know how to get the PV1 and PV2 actual power value's?
While debugging the SAJ eSolar custom component, I noticed that the totalGridPower and totalLoadPower metrics are consistently reported as 0.0, which seems incorrect. This issue occurs in the context of fetching data for my solar energy system.
Upon closer inspection through the web interface (via Inspect Element), the actual values for these metrics are shown correctly (e.g., totalGridPower: 2507.0, totalLoadPower: 2507.0 on 2024-03-24 01:40:00). It appears that the integration may not be parsing or handling the data correctly from the API response.
Debug logs show the following for these metrics:
2024-03-24 01:46:05.657 DEBUG (MainThread) [custom_components.saj_esolar.sensor] Device: totalGridPower State: 0.0
2024-03-24 01:46:05.657 DEBUG (MainThread) [custom_components.saj_esolar.sensor] Device: totalLoadPower State: 0.0
However, the API response clearly provides non-zero values:
"totalGridPower": 2507.0,
"totalLoadPower": 2507.0,
...
After upgrading my inverter from the R5 series to the R6 series (R6-20K-T2-32), I continued using the same SAJ Sec Module (M5370G2025XXXXXX). It's possible that this hardware change might be influencing how data is reported or interpreted by the integration, leading to the observed discrepancies in totalGridPower and totalLoadPower metrics.
Including this information will help developers to better understand the potential impact of hardware changes on the integration's functionality.
H1 with batteries you can get the average battery temperature.
Will make a pull request soon. I have this working.
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.
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
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
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.
It would be great to be able to charge and discharge the battery and control it through home assistant (with an automation for example)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.