I wrote a device for my enlighten pv system. Not sure how similar the api is but you can have a look at my code to see if it is a good starting point.
It looks like this