Help editing sketch. Will pay

Hi all,

I'm using a ESP8266 connected via a RJ12 to my soladin 600 (grid tie inverter)

I'm using a sketch and library from:

It reads the data from the soladin inverter and posts it to thingspeak.

The library that is used for communicating with the soladin inverter is called soladin.h and is capable of reading many variables such as device temperature, grid voltage, total power, etc but the only value I'm interested in is 'gridpower' as this shows the output of the solar panels.

Rather than having the data sent to thingspeak I'd like it sent to my local MQTT broker (mosquitto) running on a Raspberry Pi so I can incorporate the data into my home assistant setup.

Gridpower is the only value I wish to publish to MQTT

I know the ESP8266 supports MQTT with the library: PubSubClient.h

If you're still reading I'm sure you've guessed I have no idea how to write a sketch beyond the basics. I've been trying to research how to do this myself but it's beyond my capabilities. I'm willing to pay someone for their time.

Summary: Convert sketch that posts data to thingspeak so that it publishes to MQTT instead.



Just a quick update if anyone is interested.

I've still not been able to compose a sketch with uses MQTT but I have been able a accomplish my end goal with the following:

Using the thingspeak last entry API:

Which returns:


Watts being produced is the end numerical value. 26w (It's a cloudy day)

Compose a python script ( to return the value and print only the required data:

Import urllib htmlfile = urllib.urlopen("") htmltext = () print htmltext[63:-5]



Compose a sh script to run at boot, publish to MQTT and repeat every 15 seconds (can't be less than 15 seconds due to thingspeak only updating every 15 seconds):


while true do soladin="$(sudo python /home/pi/ mosqitto_pub -t energy/soladin -m "$soladin" sleep 15 done

It's a bit of a bodge job but gets the job done. If anyone can suggest a better way of doing this feel free to make a suggestion.