I need to get evse to stay in eco mode using MQTT

Hi forgive me if this has been shown before .
At present i have EVSE charging unit with wifi interface this logs data to emonpi this is just the code running on rasbery pi . this also logs data from mysolar and battery system via an auduino that is reading mod bus values and writing them up to the emonpi.
i have the eco mode working on the evse unit viq Mqtt but i am strugling with how to use the Divertmode/set command . i think that i need this set up on the emonpi to send a value 2 to a input under the topic emon/divertmode /set but i have trolled the internet and this site and i can not find any instruction that actualy shows what to write in the emon pi to get this to work ?
if some one could post a screen shot or two to show where and how to write this code it would be help .
Allso is it also possable to use a simalar way to send the correct mains voltage to the EVSE unit as mine is reading low KW due to my mains voltage being around the 250 v mark . i have this voltage avalable as a input to the emonpi
many thanks bill EVSE firmware 5.1.0.EU wifi firmware is 2.8.1 emonpi version [low-write 10.1.2

A belated welcome, Bill.

I’m not an EVSE specialist, so I can’t help. I think this is one for @TrystanLea or @glyn.hudson

Hi Bill,

Divert mode can be set via MQTT:

Normal mode:
{base-topic}/divertmode/set 1

EcoMode:
{base-topic}/divertmode/set 2

There are various ways to post to MQTT, for testing you can use mosquitto_pub via emonpi shell:

Assuming your base topic is openevse and your using the standard emonPi MQTT server:

To publish:
mosquitto_pub -h localhost -u emonpi -P emonpimqtt2016 -t openevse/divertmode/set -m 2

To subscribe:
mosquitto_sub -h localhost -u emonpi -P emonpimqtt2016 -t openevse/#

I like using the Chrome extension MQTT lease for testing. NodeRED is also very useful for automate posting to MQTT based on other events.

In Emoncms you can multiple the EVSE charging current by a measured VRMS value to obtain a more accurate kWh calculation.

Thanks for the response I will try to do this later to my system .
Eventually what I will want to try and do is to make the charger use pv Energey during the day to charge . When ever the car is plugged in then if no charge during the day ie no pv then during the night switch to normal charge mode when cheap rate is available .
Also is it possible to pass the correct voltage back to the charger as I have this available being logged on emon pi Regards bill

A post was split to a new topic: OpenEVSE with MG ZS EV