@indykoning I have a OneSolar inverter. The OneSolar wifi dongle seems to be a rebadged Growatt wifi dongle. Instead of connecting to the Growatt server, the dongle connects to the SMTEN server. Other than that, everything else seems to be exactly the same.
import growattServer
api = growattServer.GrowattApi()
api.server_url = 'http://server.smten.com/'
login_response = api.login(<username>, <password>)
#Get a list of growatt plants.
print(api.plant_list(login_response['userId']))
As you can see above, I used the api.server_url variable to point to the the SMTEN server instead of the default Growatt server.
Would it be possible to add server_url as an optional configuration item to the HomeAssistant Growatt component? That way, I would be able to get my invertor talking to HA.
Hi @pobl
I tried using this, it works on the total sensors but inverter sensors appears to be not linked, hence all values shows as 0.
Have I missed anything?
I am currently working on displaying these values nicely in Home Assistant.
I have not had any success with the Growatt integration - it did not give me the values I wanted.
So I ended up writing a small Python script that scrapes the site and sends the values to Home Assistant…
I have added the Growatt sensor and it extracting the correct values during the day, it is not using timezone correctly. I am in GMT + 10, and it seems to reset the Growatt Total Energy Today and the same for the inverter at around 8pm, how or where do I set the timezone correctly?
Last friday I got solar pannels with a growatt inverter (GroWatt MIN 5000TL-XE) and offcourse a wifi stick. Added it directly to HA. I only have to general sensors and not the specific inverter sensors. Can someone help me to get the inverter sensors?
Hi @indykoning
I’m so sorry but i’m very new in that software and applications, so I can’t add growatt storage on my Home assistant.
Could you explain how can I integrate your precious py code to home assistant?
Till now I can take values only from inverter but I miss battery soc and load consumption
Thanks a lot.
Hi @Danros3 and @spock85,
Actually the custom component is outdated when compared to the one in Home Assistant now. The custom component is the version as it is in Home Assistant 0.99.
After this compatibility for seperate storage devices have been added (i dont remember a specific version but 0.110+ should be fine).
I will update the custom component with what i have running locally for me (getting temperatures from the inverters themselves) which i will try merging into home assistant once i have the time.
If you’re getting empty values and know a slight bit of python, try messing with the example in https://github.com/indykoning/PyPi_GrowattServer
You can download a zip and run the whole thing or only download the example and install GrowattServer using pip. See if you can find a way to show the data there.
import growattServer
api = growattServer.GrowattApi()
login_response = api.login('<username>', '<password>')
#Get a list of growatt plants.
plants = api.plant_list(login_response['userId'])
deviceList = api.device_list(plants['data'][0]['plantId'])
print(deviceList)
into the example.py or a new .py file, change the credentials and run it using python example.py
Then send me the output of it (feel free to remove the Sn and deviceAlias)
It should hopefully look something like this
My guess is that the “DeviceType” is returning something different than inverter.
The integration currently only supports ‘inverter’ and ‘storage’ but maybe the name is slightly different while it would work perfectly normal if only recognised as an inverter.
i do indeed, i wrote a small blog post about how i discovered the endpoints for future reference.
I only know how to do it with android though.
You’ll only really be interested in the “Getting the data i want” heading.
Then you can try getting the data via the example:
import growattServer
api = growattServer.GrowattApi()
login_response = api.login('<username>', '<password>')
#Get a list of growatt plants.
plants = api.plant_list(login_response['userId'])
deviceList = api.device_list(plants['data'][0]['plantId'])
def inverter_detail(self, inverter_id):
response = api.session.get(api.get_url('newInverterAPI.do'), params={
'op': 'getInverterDetailData',
'inverterId': inverter_id
})
data = json.loads(response.content.decode('utf-8'))
return data
print(inverter_detail(deviceList[0]["deviceSn"]))
And of course change the url, params and function name to fit your discoveries.
If you get an “op” with _two or _one etc. try removing it. I learnt after publishing that you get way more data if you remove those.
The Growatt wifi dongle shows in my DHCP device list as an ESP_xxxxx device, same as all my other ESP2866 devices. I wonder if it would be possible to put ESPHOME on it and get the data out of it directly that way via local wifi.