I do something similar. I tried a number of different ways and found NodeRed by far the easiest way. The first thing you need to do is get your solar export input publishing to NodeRed. From there you can make decisions when to switch the charger on and off. For that part of it you will find help on the NodeRed forum: https://groups.google.com/forum/#!forum/node-red