Peblar charger

Is there anyone that managed to add a Peblar charger to Homey, and to read/set charging currents?

Connection to Peblar is possible using both REST API and MODBUS:
Peblar | Developer Information

Using a GET request to the API, I’m able to read the charging current

However I’m not able to set the charging current. According to the API documentation, setting the charging current should be done using a PATCH request. I don’t see how to do a PATCH request in Homey logic, only GET, POST, PUT and DELETE requests seems to be possible.

I tried the MODBUS option as well, but I didn’t get that working.

Anyone an idea?

For an answer you need to see that JSON file if you get one.

{
“CurrentPhase1” : 6104,
“CurrentPhase2” : 0,
“CurrentPhase3” : 0,
“EnergySession” : 2234,
“EnergyTotal” : 2207781,
“PowerPhase1” : 1422,
“PowerPhase2” : 0,
“PowerPhase3” : 0,
“PowerTotal” : 1422,
“VoltagePhase1” : 233,
“VoltagePhase2” : null,
“VoltagePhase3” : null
}

is an example of output after the GET request. So I can read that information and get the CurrentPhase1. That’s no problem.
My question was more: how can I change the charging current. According to the API documentation, that should be done with a PATCH request, and that is what I don’t know how to do

Do you already know what a Patch request is?

No :blush:

You see , there is your problem :grinning:. Just google and you will know if it is possible to make a patch request using available cards.

There can be more path data before that example of output.

I did google but didn’t find an answer, that’s why I started this new topic…
As indicated in my first post, in Homey logic, there is no such thing as PATCH request

Just try Patch Request and you will find tons of documents, i.g.

I know, but how to do it in Homey in (advanced) flows…

I don’t think you want help with your implementation, but help with everything.
I cannot help you with that.

Put your http(s) in.
Leave the rest blank.

Pls create a feature request at Athom support to add the PATCH option.

There are several HTTP methods like GET, POST, PUT , see HTTP Methods GET vs POST

So PATCH is another method. I don’t think you can use the Card GET, as it will send a request using the text GET which you cannot replace by the text PATCH. So you will need some card to send a “raw request” allowing this. For example sending an request in a Telnet session allows you this.

I have not tried it but I think it is possible using HomeyScript

Homeyscript will indeed be the solution to set the charging current. This homeyscript gives me at least a good response:

`const response = await fetch("http://<local ip>/api/wlac/v1/evinterface",{
        headers: {
            Accept: "application/json",
            "Content-Type": "application/json","Authorization":"<authorization code>"
        },
        method: "PATCH",

        body: JSON.stringify({ChargeCurrentLimit: 14000})
    })
const data = await response.json();
log(data);
`

Many thanks for the suggestions & help!

2 Likes