Hi there!!
I see that component of HA not support thinkpower solar company. I’m looking to switch from Domoticz to Home Assistant. I think all of my Domoticz setup can be achieved in Home Assistant, except for my thinkpower solar panels. In Domoticz it is possible to connect to the thinkpower-manager.com.
Are there any initiatives to have thinkpower-manager.com support in Home Assistant?
Thank so much
This depends on whether the inverter has an API that we can use with an integration.
Hi,
Just saw this thread and was hoping to also find a way to integrate the thinkpower-manager into home assistant.
I was able to get the API used when queriying the http://www.thinkpower-manager.com/ website.
Do you just need the endpoints and parameters or do you also need screenshot on what they are in ralation to the webpage?
The endpoints and parameters are important to know, otherwise it would be difficult for me to make something that retrieves that data. But doesn’t the inverter itself have an API? And I assume we get json data back and don’t have to apply some form of web scraping?
The api hits the thinkpower site and will respond with a Json response that formatted as text.
For starter, the “pwid” parameter is required but can be taken from the thinkpower URL once the user has logged in once.
One sample is this endpoint. The pwid thag I have used is from a public site that is available even if the user does not login
http://www.thinkpower-manager.com/Business/BLL/BLLTerminal/BLLTerminalStation.ashx?action=getStationRunInfo&pwid=92811
This will respond with (as of this time)
{ "Status": "Online", "ErrMsg": null, "Power": "0 W", "EToday": "29.85 KWh", "EMonth": "159.65 KWh", "EYear": "159.65 KWh", "ETotal": "321.40 KWh", "LastUpdateTime": "2023-01-27 17:37:55", "Efficiency": "1.49 KWh/KWp", "PeakPower": "5.87 KW", "Capacity": "20 KWp", "CreateTime": "2023-01-16 13:28:38", "Installer": "--", "TreesPlanted": "0.88 Trees", "CO2": "0.32 T", "Income": "$ 8.04 K", "StationImg": "5230e06b8bf148db8004e05faa59e839.png", "Lat": "31.44144144144144", "Lng": "73.15557428239138", "StationName": "wahab" }
For now, I’m using the data from the response above as a sensor and using InfluxDB and Grafana to create some stats. Though, admittedly I just finish the setup a few hours ago so no historical data has been recorded yet.
Here is the configuration that I’m currently using, not sure if this is helpful as this is just a quick and dirty one I guess…
sensor:
- platform: rest
name: Solar Overview
json_attributes:
- StationName
- Capacity
- Power
- Efficiency
- PeakPower
- EToday
- EMonth
- EYear
- ETotal
- LastUpdateTime
resource: http://www.thinkpower-manager.com/Business/BLL/BLLTerminal/BLLTerminalStation.ashx?action=getStationRunInfo&pwid=0000
value_template: "{{ value_json.StationName }}"
- platform: template
sensors:
solar_capacity:
friendly_name: "Solar Capacity"
unique_id: "solar_capacity"
value_template: "{{ state_attr('sensor.solar_overview','Capacity')|replace(' KWp','')|float }}"
unit_of_measurement: "KWp"
solar_current_power:
friendly_name: "Current Power"
unique_id: "solar_current_power"
value_template: "{% if 'KW' in state_attr('sensor.solar_overview','Power') %} {{ state_attr('sensor.solar_overview','Power')|replace(' KW','')|float * 1000 }} {% else %} {{ state_attr('sensor.solar_overview','Power')|replace(' W','')|float }} {% endif %}"
unit_of_measurement: "W"
solar_efficiency:
friendly_name: "Efficiency"
unique_id: "solar_efficiency"
value_template: "{{ state_attr('sensor.solar_overview','Efficiency')|replace(' KWh/KWp','')|float }}"
unit_of_measurement: "KWh/KWp"
solar_peak_power:
friendly_name: "Peak Power"
unique_id: "solar_peak_power"
value_template: "{{ state_attr('sensor.solar_overview','PeakPower')|replace(' KW','')|float }}"
unit_of_measurement: "KW"
solar_todays_energy:
friendly_name: "Today's Energy"
unique_id: "solar_todays_energy"
value_template: "{% if 'KW' in state_attr('sensor.solar_overview','EToday') %} {{ state_attr('sensor.solar_overview','EToday')|replace(' KWh','')|float }} {% else %} {{ state_attr('sensor.solar_overview','EToday')|replace(' Wh','')|float / 1000 }} {% endif %}"
unit_of_measurement: "KWh"
solar_monthly_energy:
friendly_name: "Monthly Energy"
unique_id: "solar_monthly_energy"
value_template: "{{ state_attr('sensor.solar_overview','EMonth')|replace(' KWh','')|float}}"
unit_of_measurement: "KWh"
solar_yearly_energy:
friendly_name: "Yearly Energy"
unique_id: "solar_yearly_energy"
value_template: "{% if 'KW' in state_attr('sensor.solar_overview','EYear') %} {{ state_attr('sensor.solar_overview','EYear')|replace(' KWh','')|float }} {% else %} {{ state_attr('sensor.solar_overview','EYear')|replace(' Wh','')|float / 1000 }} {% endif %}"
unit_of_measurement: "KWh"
solar_total_energy:
friendly_name: "Total Energy"
unique_id: "solar_total_energy"
value_template: "{% if 'KW' in state_attr('sensor.solar_overview','ETotal') %} {{ state_attr('sensor.solar_overview','ETotal')|replace(' KWh','')|float }} {% else %} {{ state_attr('sensor.solar_overview','ETotal')|replace(' Wh','')|float / 1000 }} {% endif %}"
unit_of_measurement: "KWh"
There are also other api endpoints, but I think majority of them are just based on this information with them saving the raw data in to their db and generating aggregate reports from there.
As of the moment, I’m also trying to find a way to see if I can get the api used to extract the data directly from the inverter, I think Wireshark should be able to do this, but I’m not that familiar with that tool.
Updated the config file to reflect the data conversions
Thanks for the information, an integration can certainly be made for this. I do find it strange that you can simply request this data without any form of security. If there are more URLs that can be used, I’m curious what they are.
My preference would ultimately be that you can read the inverter locally (if that option is available).
Hi,
Yep, same here, was a bit concern the lack of security features.
As of the moment, here are the list of the endpoints that i have found, the sample below are all using the a public pwid:
Power Generated Over Time:
http://www.thinkpower-manager.com/Business/BLL/BLLTerminal/BLLTerminalStation.ashx?action=getTerminalChartData&chartType=power&dateType=day&date=01%2F28%2F2023&pwid=92811&ssid=
Total Energy Generated Per day:
http://www.thinkpower-manager.com/Business/BLL/BLLTerminal/BLLTerminalStation.ashx?action=getTerminalChartData&chartType=energy&dateType=month&date=01%2F28%2F2023&pwid=92811&ssid=
Total Energy Comparison Per Month:
http://www.thinkpower-manager.com/Business/BLL/BLLTerminal/BLLTerminalStation.ashx?action=getComparedChartData&pwid=92811&type=month&date=2023%2C2022%2C2021
Total Energy Comparison Per Year:
http://www.thinkpower-manager.com/Business/BLL/BLLTerminal/BLLTerminalStation.ashx?action=getComparedChartData&pwid=92811&type=year&date=2023%2C2022%2C2021
Real Time Values (i think the only thing that needs to be change is still the pwid, all other params can be set as-is)
http://www.thinkpower-manager.com/Business/BLL/BLLTerminal/BLLTerminalReal.ashx?action=queryReal&pwid=92811&condition=%5B%5D¶ms=%7B%22gridId%22%3A%22div_real%22%2C%22dataMode%22%3A%22manual%22%2C%22navId%22%3A%22div_nav_pg%22%2C%22customHead%22%3Atrue%2C%22customHeadID%22%3A%22tb_real%22%2C%22customDataRowID%22%3A%22%22%2C%22url%22%3A%22%2FBusiness%2FBLL%2FBLLTerminal%2FBLLTerminalReal.ashx%3Faction%3DqueryReal%26pwid%3D80751%22%2C%22perPage%22%3A10%2C%22tableLine%22%3A%22auto%22%2C%22cols%22%3A%5B%7B%7D%2C%7B%7D%2C%7B%7D%2C%7B%7D%2C%7B%7D%2C%7B%7D%2C%7B%7D%2C%7B%7D%2C%7B%7D%2C%7B%7D%2C%7B%7D%2C%7B%7D%2C%7B%7D%2C%7B%7D%2C%7B%7D%5D%7D&currPage=1
Monthly Reports:
http://www.thinkpower-manager.com/Business/BLL/BLLTerminal/BLLTerminalReport.ashx?action=previewReport&pwid=92811&repType=month&date=2023-01&sn=
Yearly Reports:
http://www.thinkpower-manager.com/Business/BLL/BLLTerminal/BLLTerminalReport.ashx?action=previewReport&pwid=92811&repType=year&date=2023&sn=
All of them will respond with a json file.
Additionally, itseems that the json attribute Power will return either KW or W, so you may take that into consideration.
With regards to the local API endpoints, i tried using wireshark in promiscuous mode, but i can’t seem to find any http request going to the inverter, my guess is that my router is encrypting the traffic and posting it as different protocol.
If you have any way or can point me to a reference that i can use to monitor or brute force api end point guessing then that would be helpfull on me trying to find the local endpoints.
let me know if you need additonal information.
hi @klaasnicolaas ,
I tried reading the tcpdump from my UniFi AP where the inverter is connected.
With my limited knowledge on reading the logs via wireshark, I can’t see any HTTP requests, all request are via TCP. not like when i do the config API call that i found when opening the inverted IP on the browser.
Reading the TCP logs, there is no indicator on how the thinkpower website is doing the request.
For now, my assumption is that the inverter is just broadcasting the data into the thinkpower server.
I’ll still try and see if i can still find a way to get the data directly from the inverter, though for now, i;m just doing it on my spare time due to work load.
I also tried emailing the support email posted on their website a few days ago, but it is very unlikely that they will respond to the email.
Thanks.
Any update on this, this is the last integration i need in my home assistant.
All other devices installed in my house already configured in my home assistant which was installed on orangepi 3b 4GB ram.