SmartEVSE-2 icon indicating copy to clipboard operation
SmartEVSE-2 copied to clipboard

How to determine the Charging States from Terminal.

Open qasimali-byte opened this issue 4 years ago • 28 comments

hi, I am reading the EVSE terminal using python3. I want to read the states (Connected, Charging, Disconnected) which are not available in the terminal. But when I go through the EVSE C code I figure out (State A, State B, State C) are available in the code. but these settings are not available on the terminal. Could you please help me out with the issue? @wido @bobosch @Links2004 @mstegen @maximevince

qasimali-byte avatar May 10 '21 10:05 qasimali-byte

Currently you can read the charge state only over Modbus (RS485), https://github.com/SmartEVSE/SmartEVSE-2/tree/b8b6a1a2def22a2bfc3cc30be2f2ef639e2d4389#register-for-external-devices

bobosch avatar May 11 '21 18:05 bobosch

@bobosch thanks for your comment. could you please answer me that can i connect the Following Chint Smart Energy meter with Smart EVSE over the modbus and show the Chint meter values on the terminal ? image

qasimali-byte avatar May 12 '21 08:05 qasimali-byte

Currently you can read the charge state only over Modbus (RS485), https://github.com/SmartEVSE/SmartEVSE-2/tree/b8b6a1a2def22a2bfc3cc30be2f2ef639e2d4389#register-for-external-devices

so as we already reading the terminal through rx,tx availbale on the Smart EVSE . so you are saying if i want to read the states values then we should communicate with Smart EVSE over the RS-485 and then read the States Values ?

qasimali-byte avatar May 12 '21 08:05 qasimali-byte

If you are using the terminal, you can also send the serial command STATE? The SmartEVSE will answer with:

EVSE0:B(16.0A),EVSE1:C(12.0A),EVSE2:A(0.0A),EVSE3:A(0.0A),EVSE4:A(0.0A),EVSE5:A(0.0A),EVSE6:A(0.0A),EVSE7:A(0.0A)

mstegen avatar May 12 '21 09:05 mstegen

If you are using the terminal, you can also send the serial command STATE? The SmartEVSE will answer with:

EVSE0:B(16.0A),EVSE1:C(12.0A),EVSE2:A(0.0A),EVSE3:A(0.0A),EVSE4:A(0.0A),EVSE5:A(0.0A),EVSE6:A(0.0A),EVSE7:A(0.0A)

Thanks, @mstegen for your comment. as my question was I want to determine the states (Connected, Charging, Disconnected) I hope you understood my question. but as you answered that if I send the serial command State over the terminal. the answer of the Smart EVSE will be EVSE0:B(16.0A),EVSE1:C(12.0A),EVSE2:A(0.0A),EVSE3:A(0.0A),EVSE4:A(0.0A),EVSE5:A(0.0A),EVSE6:A(0.0A),EVSE7:A(0.0A) . but how can I extract the state from this line that Currently what is the state?

qasimali-byte avatar May 12 '21 09:05 qasimali-byte

If it's state A, then it's Disconnected. In the above example EVSE2-7 are Disconnected. State B is Connected (only EVSE0 , the Master in this case) State C is Charging (only EVSE1 , it's charging at 12.0A at the moment)

mstegen avatar May 12 '21 09:05 mstegen

If it's state A, then it's Disconnected. In the above example EVSE2-7 are Disconnected. State B is Connected (only EVSE0 , the Master in this case) State C is Charging (only EVSE1 , it's charging at 12.0A at the moment)

okay. so you are talking about the LOADBL when we enable this we have Master, Node 1----Node 7. so we can determine the states accordingly. am I right?

qasimali-byte avatar May 12 '21 09:05 qasimali-byte

If it's state A, then it's Disconnected. In the above example, EVSE2-7 is Disconnected. State B is Connected (only EVSE0, the Master in this case) State C is Charging (the only EVSE1, it's charging at 12.0A at the moment) As we give only those commands to the Terminal which are available on the terminal. STATE command is not available on the terminal.

qasimali-byte avatar May 12 '21 09:05 qasimali-byte

You should use STATE? Yes It will display all states for all Nodes including the Master. The STATE? command only gives usable results on the Master.

mstegen avatar May 12 '21 10:05 mstegen

If you are using the terminal, you can also send the serial command STATE? The SmartEVSE will answer with:

EVSE0:B(16.0A),EVSE1:C(12.0A),EVSE2:A(0.0A),EVSE3:A(0.0A),EVSE4:A(0.0A),EVSE5:A(0.0A),EVSE6:A(0.0A),EVSE7:A(0.0A)

hi! @mstegen i run STATE? commond in Master and get the EVSE0:B(16.0A),EVSE1:C(12.0A),EVSE2:A(0.0A),EVSE3:A(0.0A),EVSE4:A(0.0A),EVSE5:A(0.0A),EVSE6:A(0.0A),EVSE7:A(0.0A) could you please tell me in the above result which is my EVSE . as There are two EVSE0:B(16.0A),EVSE1:C(12.0A) displaying how can i recognize which is my EVSE ?

qasimali-byte avatar May 24 '21 12:05 qasimali-byte

The Master is EVSE0

mstegen avatar May 24 '21 12:05 mstegen

Ok, thanks. But what about EVSE1 who is also displaying some current. Is it that way

EVSE 0--- Master EVSE 1--- Node1 ..... EVSE 7----Node 7

On Mon, May 24, 2021, 5:41 PM Michael Stegen @.***> wrote:

The Master is EVSE0

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/SmartEVSE/SmartEVSE-2/issues/12#issuecomment-847015653, or unsubscribe https://github.com/notifications/unsubscribe-auth/AOCJ7TQXMCSR23JFIXXYOJ3TPJCRHANCNFSM44QZMUCQ .

qasimali-byte avatar May 24 '21 12:05 qasimali-byte

The Master is EVSE0

Ok, thanks to @mstegen . But what about EVSE1 who is also displaying some current. Is it that way

EVSE 0 --->Master EVSE 1 --->Node1 . . EVSE 7--->Node 7

qasimali-byte avatar May 25 '21 07:05 qasimali-byte

Yes that's correct.

mstegen avatar May 25 '21 07:05 mstegen

okay. Thanks, It's means when we connect Something with Node1---Node7 they will also display their status and Currents.?

qasimali-byte avatar May 25 '21 07:05 qasimali-byte

Yes, for each connected controller the current STATE and max charge current is displayed.

mstegen avatar May 25 '21 08:05 mstegen

Ok, thanks for the clarification.

On Tue, May 25, 2021, 1:00 PM Michael Stegen @.***> wrote:

Yes, for each connected controller the current STATE and max charge current is displayed.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/SmartEVSE/SmartEVSE-2/issues/12#issuecomment-847643491, or unsubscribe https://github.com/notifications/unsubscribe-auth/AOCJ7TWDMTREJKZ5ACK6EOLTPNKJTANCNFSM44QZMUCQ .

qasimali-byte avatar May 25 '21 08:05 qasimali-byte

hi , @mstegen i am facing the issue regarding getting the States . as there is no Curennt Showing in EVSE Screen as well as on the STATE? Commond . can you please help me out where i am doing mistake . Terminal Screen

qasimali-byte avatar Jun 02 '21 11:06 qasimali-byte

Somehow the sensorbox is not measuring any current. Are you using a sensorbox or are you emulating it in software? If you can send a picture of your complete setup, that might help.

Or do you mean the charging current? That will only show if you are actually charging. Then the STATE? data will also change.

mstegen avatar Jun 02 '21 12:06 mstegen

This is the picture of the circuit that I am using. 2nd as you mentioned that am I emulating the current from software. Could you please tell me how can I WhatsApp Image 2021-06-02 at 5 59 07 PM emulate the software?

qasimali-byte avatar Jun 02 '21 13:06 qasimali-byte

You could use the Sensorbox 1.5 code as a starting point, but i guess you have that atleast partly working, otherwise the SmartEVSE will show an error message on the LCD.

mstegen avatar Jun 02 '21 14:06 mstegen

You could use the Sensorbox 1.5 code as a starting point, but i guess you have that atleast partly working, otherwise the SmartEVSE will show an error message on the LCD.

Sorry @mstegen i didn't actually understand. can you please explain more ?

qasimali-byte avatar Jun 03 '21 08:06 qasimali-byte

Sensorbox 1.5 code

yes i am using the Sensorbox 1.5 version .but EVSE not showing the Current. How can i emulate the Current from the Software?

qasimali-byte avatar Jun 03 '21 12:06 qasimali-byte

for (x=0; x<3 ;x++) {
                    Irms[x] = Irms[x]* CAL;
                    pBytes = (char*)&Irms[x];                                   // get raw 4 byte Double 
                    Tbuffer[n++] = pBytes[3];                                   // Send MSB first
                    Tbuffer[n++] = pBytes[2];
                    Tbuffer[n++] = pBytes[1];
                    Tbuffer[n++] = pBytes[0];                                   // Send LSB last
                }

This is the Sensorbox code that sends the measured current to the SmartEVSE. The measured current is stored in Irms[x]. Just change the Irms[0] to let's say 30.0 and you should see the data on the SmartEVSE.

mstegen avatar Jun 03 '21 15:06 mstegen

for (x=0; x<3 ;x++) {
                    Irms[x] = Irms[x]* CAL;
                    pBytes = (char*)&Irms[x];                                   // get raw 4 byte Double 
                    Tbuffer[n++] = pBytes[3];                                   // Send MSB first
                    Tbuffer[n++] = pBytes[2];
                    Tbuffer[n++] = pBytes[1];
                    Tbuffer[n++] = pBytes[0];                                   // Send LSB last
                }

This is the Sensorbox code that sends the measured current to the SmartEVSE. The measured current is stored in Irms[x]. Just change the Irms[0] to let's say 30.0 and you should see the data on the SmartEVSE.

hi @mstegen i changed the code as you suggest me but i am getting same result . when i entered the STATE? commond still there is no state change information. WhatsApp Image 2021-06-09 at 5 05 28 PM WhatsApp Image 2021-06-09 at 5 05 28 PM (1) WhatsApp Image 2021-06-09 at 5 05 29 PM

qasimali-byte avatar Jun 09 '21 12:06 qasimali-byte

You asked "How can i emulate the Current from the Software" This seems to be working.. I see 2A displayed on the LCD for each Phase. Also the CAL values in the CLI show the measured currents. If you want to see the set charge current with the STATE? command, then you first need to start charging. Connect a EV, or emulate one with a EV simulator (a couple of resistors and and Diode)

mstegen avatar Jun 09 '21 12:06 mstegen

okay. Thanks but my main concern with the STATE? command output. Could you please help me to simulate the Circuit so i can test the STATE command? like how many resistors required or Diode and with how much value etc?

qasimali-byte avatar Jun 09 '21 12:06 qasimali-byte

You asked "How can i emulate the Current from the Software" This seems to be working.. I see 2A displayed on the LCD for each Phase. Also the CAL values in the CLI show the measured currents. If you want to see the set charge current with the STATE? command, then you first need to start charging. Connect a EV, or emulate one with a EV simulator (a couple of resistors and and Diode)

hi, @mstegen I am using the Following circuit to emulate the EV and test the State? is that correct or need to rectify? [https://www.evalbo.de/2015/02/14/typ-2-stecker-beschaltung/] WhatsApp Image 2021-06-10 at 7 15 15 PM

qasimali-byte avatar Jun 11 '21 07:06 qasimali-byte