You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The commands in the MQTT API and the PEST API are not similar void mqtt_receive_callback(const String topic, const String payload) { if (topic == MQTTprefix + "/Set/Mode") { if (payload == "Off") { ToModemWaitStateTimer = 0; ToModemDoneStateTimer = 0; LeaveModemDoneStateTimer = 0; setAccess(0); } else if (payload == "Normal") { setMode(MODE_NORMAL); } else if (payload == "Solar") { OverrideCurrent = 0; setMode(MODE_SOLAR); } else if (payload == "Smart") { OverrideCurrent = 0; setMode(MODE_SMART); }
For mode setting Curl expects 0, 1, 2 or 3 and MQTT expects Off, Normal, Solar or Smart
I suggest to add some code like shown hereafter. void mqtt_receive_callback(const String topic, const String payload) { if (topic == MQTTprefix + "/Set/Mode") { if (payload == "Off" | payload == 0) { ToModemWaitStateTimer = 0; ToModemDoneStateTimer = 0; LeaveModemDoneStateTimer = 0; setAccess(0); } else if (payload == "Normal" | payload == 1) { setMode(MODE_NORMAL); } else if (payload == "Solar" | payload == 2) { OverrideCurrent = 0; setMode(MODE_SOLAR); } else if (payload == "Smart" | payload == 3) { OverrideCurrent = 0; setMode(MODE_SMART); }
In the documentation just 0, 1, 2 and 3 are described.
Same goes for ip-of-evse/settings - override_current
Curl command - override_current
MQTT command - CurrentOverride
mosquitto_sub returns - ChargeCurrentOverride
By adding some ' | ' here and there the naming could get more consistent and can be reflected like that in the docs without having to change the code heavily.
The text was updated successfully, but these errors were encountered:
Very legit topic; it is the result of evolutionary development and the wish to stay backwards compatible.
We are currently spending our developers capacity at expanding the functionality of the SmartEVSE (e.g. v4 with SoC communication from the EV), keeping "nice-to-haves" at low priority to prevent diverting forks.
The commands in the MQTT API and the PEST API are not similar
void mqtt_receive_callback(const String topic, const String payload) { if (topic == MQTTprefix + "/Set/Mode") { if (payload == "Off") { ToModemWaitStateTimer = 0; ToModemDoneStateTimer = 0; LeaveModemDoneStateTimer = 0; setAccess(0); } else if (payload == "Normal") { setMode(MODE_NORMAL); } else if (payload == "Solar") { OverrideCurrent = 0; setMode(MODE_SOLAR); } else if (payload == "Smart") { OverrideCurrent = 0; setMode(MODE_SMART); }
For mode setting Curl expects 0, 1, 2 or 3 and MQTT expects Off, Normal, Solar or Smart
I suggest to add some code like shown hereafter.
void mqtt_receive_callback(const String topic, const String payload) { if (topic == MQTTprefix + "/Set/Mode") { if (payload == "Off" | payload == 0) { ToModemWaitStateTimer = 0; ToModemDoneStateTimer = 0; LeaveModemDoneStateTimer = 0; setAccess(0); } else if (payload == "Normal" | payload == 1) { setMode(MODE_NORMAL); } else if (payload == "Solar" | payload == 2) { OverrideCurrent = 0; setMode(MODE_SOLAR); } else if (payload == "Smart" | payload == 3) { OverrideCurrent = 0; setMode(MODE_SMART); }
In the documentation just 0, 1, 2 and 3 are described.
Same goes for ip-of-evse/settings - override_current
Curl command - override_current
MQTT command - CurrentOverride
mosquitto_sub returns - ChargeCurrentOverride
By adding some ' | ' here and there the naming could get more consistent and can be reflected like that in the docs without having to change the code heavily.
The text was updated successfully, but these errors were encountered: