# Peblar charger

**URL:** <https://community.homey.app/t/peblar-charger/129830>\
**Category:** Devices\
**Created:** [February 5, 2025, 1:29pm UTC](https://community.homey.app/t/peblar-charger/129830 "2025-02-05T13:29:54Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![StevenV](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/stevenv/32/97437_2.png) [@StevenV](https://community.homey.app/u/StevenV)\
**Post date:** [February 5, 2025, 1:29pm UTC](https://community.homey.app/t/peblar-charger/129830/1 "2025-02-05T13:29:54Z")

</div>

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](https://developer.peblar.com/)

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

 ![image](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/5/4/54c2e4dbba3ee25ba139b8c2133b8a2bf2f98280.png)

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?

---

<div class="post-metadata">

**Author:** ![Theo\_de\_Koning](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/theo_de_koning/32/136062_2.png) [@Theo\_de\_Koning](https://community.homey.app/u/Theo_de_Koning)\
**Post date:** [February 5, 2025, 1:37pm UTC](https://community.homey.app/t/peblar-charger/129830/2 "2025-02-05T13:37:21Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![StevenV](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/stevenv/32/97437_2.png) [@StevenV](https://community.homey.app/u/StevenV)\
**Post date:** [February 5, 2025, 2:30pm UTC](https://community.homey.app/t/peblar-charger/129830/3 "2025-02-05T14:30:32Z")

</div>

{  
“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

---

<div class="post-metadata">

**Author:** ![Rmb](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/rmb/32/79135_2.png) [@Rmb](https://community.homey.app/u/Rmb)\
**Post date:** [February 5, 2025, 2:38pm UTC](https://community.homey.app/t/peblar-charger/129830/4 "2025-02-05T14:38:13Z")

</div>

Do you already know what a Patch request is?

---

<div class="post-metadata">

**Author:** ![StevenV](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/stevenv/32/97437_2.png) [@StevenV](https://community.homey.app/u/StevenV)\
**Post date:** [February 5, 2025, 2:39pm UTC](https://community.homey.app/t/peblar-charger/129830/5 "2025-02-05T14:39:39Z")

</div>

No 😊

---

<div class="post-metadata">

**Author:** ![Rmb](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/rmb/32/79135_2.png) [@Rmb](https://community.homey.app/u/Rmb)\
**Post date:** [February 5, 2025, 2:41pm UTC](https://community.homey.app/t/peblar-charger/129830/6 "2025-02-05T14:41:39Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Theo\_de\_Koning](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/theo_de_koning/32/136062_2.png) [@Theo\_de\_Koning](https://community.homey.app/u/Theo_de_Koning)\
**Post date:** [February 5, 2025, 2:50pm UTC](https://community.homey.app/t/peblar-charger/129830/7 "2025-02-05T14:50:18Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![StevenV](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/stevenv/32/97437_2.png) [@StevenV](https://community.homey.app/u/StevenV)\
**Post date:** [February 5, 2025, 3:53pm UTC](https://community.homey.app/t/peblar-charger/129830/8 "2025-02-05T15:53:01Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Rmb](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/rmb/32/79135_2.png) [@Rmb](https://community.homey.app/u/Rmb)\
**Post date:** [February 5, 2025, 4:18pm UTC](https://community.homey.app/t/peblar-charger/129830/9 "2025-02-05T16:18:30Z")

</div>

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

> **[Difference Between PUT and PATCH Request - GeeksforGeeks](https://www.geeksforgeeks.org/difference-between-put-and-patch-request/)**
>
> HTTP PUT replaces an entire resource on the server, while PATCH only updates specific parts of that resource, making PATCH more efficient for partial updates.

---

<div class="post-metadata">

**Author:** ![StevenV](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/stevenv/32/97437_2.png) [@StevenV](https://community.homey.app/u/StevenV)\
**Post date:** [February 5, 2025, 4:21pm UTC](https://community.homey.app/t/peblar-charger/129830/10 "2025-02-05T16:21:44Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Rmb](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/rmb/32/79135_2.png) [@Rmb](https://community.homey.app/u/Rmb)\
**Post date:** [February 5, 2025, 5:39pm UTC](https://community.homey.app/t/peblar-charger/129830/11 "2025-02-05T17:39:50Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Theo\_de\_Koning](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/theo_de_koning/32/136062_2.png) [@Theo\_de\_Koning](https://community.homey.app/u/Theo_de_Koning)\
**Post date:** [February 5, 2025, 5:51pm UTC](https://community.homey.app/t/peblar-charger/129830/12 "2025-02-05T17:51:10Z")

</div>

![](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/c/8/c8c3e9fa8fa5348b47971d7ee185e7e978618dfb.jpeg)

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

---

<div class="post-metadata">

**Author:** ![Dijker](https://avatars.discourse-cdn.com/v4/letter/d/b9bd4f/32.png) [@Dijker](https://community.homey.app/u/Dijker)\
**Post date:** [February 5, 2025, 7:13pm UTC](https://community.homey.app/t/peblar-charger/129830/13 "2025-02-05T19:13:49Z")

</div>

> [@StevenV](#):
>
> I don’t see how to do a PATCH request in Homey logic, only GET, POST, PUT and DELETE requests seems to be possible.

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

---

<div class="post-metadata">

**Author:** ![Rmb](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/rmb/32/79135_2.png) [@Rmb](https://community.homey.app/u/Rmb)\
**Post date:** [February 5, 2025, 7:14pm UTC](https://community.homey.app/t/peblar-charger/129830/14 "2025-02-05T19:14:27Z")

</div>

There are several HTTP methods like GET, POST, PUT , see [HTTP Methods GET vs POST](https://www.w3schools.com/tags/ref_httpmethods.asp)

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.

---

<div class="post-metadata">

**Author:** ![Dijker](https://avatars.discourse-cdn.com/v4/letter/d/b9bd4f/32.png) [@Dijker](https://community.homey.app/u/Dijker)\
**Post date:** [February 5, 2025, 7:31pm UTC](https://community.homey.app/t/peblar-charger/129830/15 "2025-02-05T19:31:13Z")

</div>

> [@StevenV](#):
>
> but how to do it in Homey in (advanced) flows

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

> **[Home - HomeyScript](https://athombv.github.io/com.athom.homeyscript/)**

---

<div class="post-metadata">

**Author:** ![StevenV](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/stevenv/32/97437_2.png) [@StevenV](https://community.homey.app/u/StevenV)\
**Post date:** [February 5, 2025, 9:14pm UTC](https://community.homey.app/t/peblar-charger/129830/16 "2025-02-05T21:14:12Z")

</div>

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

```auto
`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!

---

<div class="post-metadata">

**Author:** ![Tim\_S](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/tim_s/32/56366_2.png) [@Tim\_S](https://community.homey.app/u/Tim_S)\
**Post date:** [February 18, 2025, 9:03am UTC](https://community.homey.app/t/peblar-charger/129830/17 "2025-02-18T09:03:11Z")

</div>

Hi trying, to achieve the same ; but I’m a real newbe in homey script… is there a way you can share the full code ?

---

<div class="post-metadata">

**Author:** ![StevenV](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/stevenv/32/97437_2.png) [@StevenV](https://community.homey.app/u/StevenV)\
**Post date:** [February 18, 2025, 10:43am UTC](https://community.homey.app/t/peblar-charger/129830/18 "2025-02-18T10:43:24Z")

</div>

In your flow, add a HomeyScript flowcard to execute a script using a logic variable:  
 ![image](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/5/9/59d7031a03a7f1c75c49f8f814a5506f1408eefc.png)

Click on **// My Code** to add the script. And on **My Arg** to add at which mA value you want to charge.

In the example below, the homey logic variable “Pblar\_max-mA” contains the value of mA at which I want to charge.  
 ![image](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/0/8/08ed7b3ab262fe5edd56ea5631be6ef4e15e7330.png)

The script itself is then like this:

> // Set max mA  
> limit=parseInt(args[0]);  
> //const response = await fetch  
> await fetch(“http://[_your local IP address_]/api/wlac/v1/evinterface”,{  
> headers: {  
> Accept: “application/json”,  
> “Content-Type”: “application/json”,“Authorization”:“[your authorization code]”  
> },  
> method: “PATCH”,
> 
> ```
> body: JSON.stringify({ChargeCurrentLimit: limit})
> })
> 
> ```

Adjust in the above script your local IP address and authorization code (which you obtain from the Peblar local web interface)

(Please note that this defines the maximum current at which the Peblar can charge. If there are other limits that apply, the actual current used might be lower, eg if you use solar charging or if there is a household limit set)

---

<div class="post-metadata">

**Author:** ![Tim\_S](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/tim_s/32/56366_2.png) [@Tim\_S](https://community.homey.app/u/Tim_S)\
**Post date:** [February 19, 2025, 6:52pm UTC](https://community.homey.app/t/peblar-charger/129830/19 "2025-02-19T18:52:17Z")

</div>

ok thx. a pitty that the API has so limited capabilties vs the home assistant integration…

---

<div class="post-metadata">

**Author:** ![StevenV](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/stevenv/32/97437_2.png) [@StevenV](https://community.homey.app/u/StevenV)\
**Post date:** [February 19, 2025, 8:07pm UTC](https://community.homey.app/t/peblar-charger/129830/20 "2025-02-19T20:07:59Z")

</div>

Next to changing the max current, you can also write a script to change number of phases to 1 phase. Those are indeed limited changes you can make to the charger via the API. But you can also read some data from the charger. See the API documentation  
[https://developer.peblar.com/](https://developer.peblar.com/)

My understanding is that home assistant is using the same API, so normally whatever is possible with home assistant you should be able to do with homey as well, but you would need to spend some time in creating flows and scripts…

[Next page](https://community.homey.app/t/peblar-charger/129830.md?page=2)
