JuiceNet EV Charger - Can't trigger charge start

I have completed integrations with my JuiceNet EV charging station, as well as my home energy monitoring solutions.

I want to set up a trigger so that when my solar generation can completely cover the power needed to charge my vehicle, the charger is enabled. I can perform this action from the JuiceNet app as well as from the web interface, but I was surprised to find that the JuiceNet component in HomeAssist is only sensors - no controls.

How would we go about adding support to set the ‘charge override’ api from within HomeAssistant? I can see the API being used by observing the calls via the web page. Is this something that can be added simply to the existing controller code?

From a quick look at the underlying library it is fetch only.

https://github.com/jesserockz/python-juicenet/blob/20989504e78050c6e3f932f554a3e2513abe8775/pyjuicenet/__init__.py

So work would need to be done there first. Is the API documentd?

For a company that emphasises how it uses open apis they sure make it hard to find the documentation!

True that…

I can’t find anything. I can reverse engineer the command that is used via the web page, but it doesn’t appear to point to the same API as the github driver:

It looks like it’s just an XHR POST request to: https://home.juice.net/Portal/DoOverride
with parameters unitID=nnnnnnnnnnnnn&overrideOn=true

So, if their web portal is calling the same API on the backend, that’s opaque to us. I can’t find any info on how the python-juicenet client code was developed.

Interestingly, the Android app appears to call a different API. I’ll see if I can set up a proxy to see what it’s connecting to. Maybe they don’t publish an API because they can’t decide on one :slight_smile:

I recommend this app to work out what is going on with the android app. https://play.google.com/store/apps/details?id=app.greyshirts.sslcapture

Thanks, Nick.

I managed to get my hands on the API documentation. The command is very straightforward:

Request example:

{
  "cmd": “set_override”,
  "account_token": "c31a1e00-1017-4048-b0bd-423da512f4c2",
  "token": "2739f8604e4c4e30a749fe07801d8575",  
  "device_id": "DEE328A7-B7F4-4235-9A6E-CF77C0C1FA74",
  "energy_at_plugin": 0,
  "override_time": 1501064278,
  "energy_to_add": 60000
}

Response example:

{
  "success":true
}

Looks like I’ll have to either fork the api library that exists, or request the maintainer to add support for this command. Then a similar action for the HA module. Any recommendations on how to proceed?

I would start by posting an issue on the library github, asking the author if he would welcome a pull request to add further features. If he says ‘yes’, go that way. If he says ‘no’ or ignores you, try a fork.

Thanks Nick,

I’ve already submitted a pull request to add the needed API call to the underlying project. Assuming that gets merged without any difficulty, what’s the best way to add the functionality to Home Assistant? Is there a similar module that you know if that provides both sensors and an ‘override’ switch?

I don’t understand the architecture well enough to know if there’s a particular idiom I should follow, so an existing well-written module that contains both fixed sensors and switches would be a good starting point.

At this point, all my other Home Assistant modules dynamically create their entities, so I’m afraid that however they go about it would be overkill just for adding a switch to this existing driver.

1 Like

@lkeagle Old thread but I just started looking at this so maybe someone can clearify this for me. I have the juicebox since one year back. Right nowI have a very good deal from my grid provider giving me good
money of the energy I sell to the grid from my solar panels. This will last one year so until now I have not really cared when or how I charge my Renault Zoe. The price is more or less the same at all times. however this will change soon and I would really like to charge the car when the sun is shinging and lets say my inverter produces more then 5000W of energy. I can trigger this in an automatisation. That was the plan. However I am confused how to do this in the best way with my juicebox. I noticed there is now a switch in Home Assitant to charge the car now and bypassing the schedule. Does this turn on or off the juicebox? I have recived the full api when I signed a nda so maybeI can figure this out. But I really would like to hear what the best approach are. If the car is not plugged in and I pull the switch wahat will happen?