Start a new topic

Help in figuring out how to communicate with OpenEVSE

We have an EV and a PV system but don't have OpenEVSE yet. Currently I have access to our required revenue grade meters via RS485.

 So I have PV power and power to/from the grid available to me on a Linux desktop computer. A simple program can do the math and set charge current on the OpenEVSE.

1. How do I send shell command via http to the OpenEVSE to control it - charge current etc? Or Perl or Python.

I've been finding various Python and other scripts but I apparently don't understand just what RAPI and mqtt is. Like does the OpenEVSE use both communication protocols at the same time?

I would be using the hardwired ethernet board in the OpenEVSE instead of wifi as there is no wifi in the garage where the charger would be located.


2. I guess another option would be to use Home Assistant docker image but how do I get the PV and grid power data to HA?


I'll need some basic baby steps to get me going.

Thanks!



I suggest option 2, this is exactly what I do. I have defined a RESTful command as per below where "sensor.total_openevse_amps_available" is the output of your calculation as per above. If your inverter has an integration or you can use its API to query you don't need your 'Linux' calculation since HA will do it for you.


 

  set_openevse_charging_current:
    url: http://192.168.1.240/claims/client/65537
    method: POST
    payload: '{"state": "active", "charge_current": {{ states("sensor.total_openevse_amps_available") }}, "max_current": 40,"energy_limit": 0,"time_limit": 0,"auto_release": false}'
    content_type: "application/json"

 

I could not get HA and mosquitto broker to talk to each other. If you have a diy link to getting both docker images to talk I'll see if I can get it working.

In the meantime...

Using http API from here:

https://openevse.stoplight.io/docs/openevse-wifi-v4/e3153e2367cb1-open-evse-wi-fi-api


What would the sequence of commands be to initiate a charging session? Claim->config or manual override? 

Could not get the HA docker and eclipse-mosquitto docker to talk with each other. So I'm going back to just running a script to setup charging and the amount of amps to charge. My inverters have no integration with HA but I do have the data available on the linux box.


What would be the steps to initiate a charge?

Claim, config or manual override?

Using the http API from here:

https://openevse.stoplight.io/docs/openevse-wifi-v4/e3153e2367cb1-open-evse-wi-fi-api

You could just send the power available in watts to the MQTT broker and let OpenEVSE ECO/Solar Divert/Shaper take it from there.

> "What would be the steps to initiate a charge?"


I use a REST command that is defined within my configuration.yaml to do this. I send it to the OpenEVSE when the amount of current changes based on solar availability.


rest_command:

  set_openevse_charging_current_cheap:

    url: http://192.168.1.240/claims/client/65537

    method: POST

    payload: '{"state": "active", "charge_current": {{ states("sensor.total_openevse_amps_available_cheap") }}, "max_current": 40,"energy_limit": 0,"time_limit": 0,"auto_release": false}'

    content_type: "application/json"


This REST command enables charging


  enable_openevse_charging_mode:

    url: http://192.168.1.240/override

    method: DELETE

    content_type: "application/json"



This REST command stops charging


  stop_openevse_charging:

    url: http://192.168.1.240/override

    method: POST

    payload: '{"state": "disabled"}'

    content_type: "application/json"


The charger kit is here and assembled. Have not hooked it up to the car yet. But it appears to be working normally. I can communicate with it over http command line as per the specs. And I started a emoncms docker image. The openevse charger communicates with the emomcms server.


The esp32-gateway board works well. Flashed it using the instructions on github.


Thanks to everyone who helped! It got me started.

How do I get the charger to adjust charge power based on PV production? 


I am sending "grid_ie" and "solar" using http status update every 10 seconds.

Self Production is enabled in the OpenEvse Settings. But it seems to be looking for a feed from mqtt. I do not have mqtt feed.

It starts charging the car at the limit which is set to 40A but then over time the charge tapers down slowly over several minutes to 5.5A

How do I get the charger to adjust charge power based on PV production? 


I need a bit more infomation. Are you using the REST Api?

I think I need some help in understanding what I'm seeing on the esp32 webpages (version2).

On the Esp32 main webpage there's is the robot guy button that says I'll decide (or something like that). Just what does this button do? When I enable it it never charges the car.


On the SelfProduction-Production page I see the my PV production in watts. This number is correct. Then next to is is 0A in red. What does this indicate?


On SelfProduction-Export page Grid Import/Export shows 0W 0A in read. Why does this not show the grid_ie number I'm sending via http?


What is the difference between Production and Export on this webpage?


Sorry for all the questions. But I know this will work if I undertsand how it works and what I'm doing wrong.

Thanks!

My Perl function. The repsonse from the http call is OK and it prints out the response as ssen in the curly brackets in the screenshot from the prior post. So it looks like the 2 numbers (PMwatt=grid power; INVwatts=pv production) are getting to the openevse.


sub UpdStatus

{

        my %json;

        $json{solar} = $INVwatts + 0;

        $json{grid_ie} = $PMwatts + 0;


        my $req = HTTP::Request->new( 'POST', "$URL/status" );

        $req->header( 'Content-Type' => 'Accept: application/json' );

        $req->content(encode_json(\%json));


        my $response = $ua->request( $req );

        printf("%s\n", $response->content);

        return($response);

}

Rich,


You may want to post your question on our GitHub issues page. This is where the Developers of the feature and all the documentation exists.


https://github.com/OpenEVSE/ESP32_WiFi_V4.x/issues


Chris 

> My Perl function. The repsonse from the http call is OK and it prints out the response as ssen in the curly

> brackets in the screenshot from the prior post. So it looks like the 2 numbers (PMwatt=grid power; 

> INVwatts=pv production) are getting to the openevse.


[Caveat: I have OpenEVSE working happily with Home Assistant and I am not an advanced user. There are many things I do not fully understand and welcome being corrected.]


Ok, I struggled too to get my head around OpenEVSE since there are multiple ways in getting it to act as a solar spunge. My first suggestion is to ensure it is in the right mode. You alluded to this when you asked above about the "robot guy button". One suggestion is changing modes and then sending your commands. My suggestion is it needs to be in the "Enable Charge" and "Eco" modes or "AUTO (Robot)" and "Eco". You will see above with the REST commands I send from Home Assistant I use the "DELETE" method before my charging is enabled. This actually puts it into AUTO mode.


I would check within the configuration that the MQTT shaper is DISABLED and the 'Self Production' is ENABLED.


One other thing that did catch me out when I was using MQTT is the polarity of the Export/Import of your solar surplus. Negative (-) is surplus that the car can consume.


Hope this helps.

Yes! I sent the DELETE to the manual override and it set it to Auto(the robot guy). 

Shaper is disabled and self production is enabled.

Eco is enabled.

In this mode the car does not charge. I have to use manual mode to get the charge to start.

When I switch it to Auto (by clicking on the button) is when it does not work. The charge slowly tapers off to 6A. Even though I keep sending data via http.

I have the grid_ie + and - correct.


But what I find interesting in your claims REST command is that you are telling it to charge at the current that is measured by your sensor (total_openevse_amps_available_cheap). That would be manual mode?

It would appear that HA is controlling the charge current instead of the OpenEVSE?


When I update the claim it takes it out of Auto mode and puts it into Manual mode.

I suppose I could do this where I calc and send charge current to OpenEVSE but I was hoping to have 

it work in auto mode.


I posted a question on the github page as was suggested. Hopefully I'll get an answer there. The solution, I suspect, is real simple.


OK in playing around with the self production (production and export) settings I see a problem. Even though mqtt and Energy Monitoring (emoncms) are both disabled, it insists I enter a topic. There is a pre-loaded emoncms topic there that I never entered. If I erase it it gives me an error message and won't let me enable Self production. So it seems the code is insisting I use a mqtt or emoncms server.

Login or Signup to post a comment