# Sonnen Battery API

**URL:** <https://community.homey.app/t/sonnen-battery-api/54658>\
**Category:** Questions & Help\
**Tags:** app\
**Created:** [November 11, 2021, 10:28am UTC](https://community.homey.app/t/sonnen-battery-api/54658 "2021-11-11T10:28:41Z")\
**Posts on this page:** 12\
**Page:** 2

<div class="post-metadata">

**Author:** ![Rikard\_Lundgren](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/rikard_lundgren/32/49501_2.png) [@Rikard\_Lundgren](https://community.homey.app/u/Rikard_Lundgren)\
**Post date:** [September 2, 2023, 9:46am UTC](https://community.homey.app/t/sonnen-battery-api/54658/21 "2023-09-02T09:46:05Z")

</div>

Hi Bogguard,

I’ve just got my system installed (finally!) and now have the opportunity to check and test different things. Some of the things I wrote earlier is already solved! =)

I will also post this in the open forum.

The suggestions of three vital features I have now is the following:

1. Create a “Then”-card for “ **Change Operating mode** ” to **Manual** , **Self-consumption** or **Time of Use (ToU)**

 ![image](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/f/f/ffc647952acdc8a5eea68e4fb983ac56bd2b4603.png)

1. Create a “Then”-card for “ **Discharge** X (add **tag** here) watts”:

 ![image](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/d/c/dca5754e143514ed60fe29cdac0ecf9803fd0a7b.png)

1. Create a “Then”-card for “ **Charge** X (add **tag** here) watts”.

 ![image](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/6/2/62c0b46def52c69217a73f2eef636b51d007544d.png)

if possible there is a fourth suggestions and it is in regards to the mode of Time of Use:

1. Create a “Then”-card that “Set schedule for Time of Use”  
I don’t know how this works yet though… 😃

 ![image](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/2/5/2599c146ef3c7e3d97cd73fcf35bd9f3aa86d063.png)

let me know if I can be of any help!

Best regards  
Rikard

---

<div class="post-metadata">

**Author:** ![Rikard\_Lundgren](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/rikard_lundgren/32/49501_2.png) [@Rikard\_Lundgren](https://community.homey.app/u/Rikard_Lundgren)\
**Post date:** [September 2, 2023, 11:30am UTC](https://community.homey.app/t/sonnen-battery-api/54658/22 "2023-09-02T11:30:34Z")

</div>

Hi,

So far I have solved point 1, 2 and 3 above via sending a HTTP-request using Homey Logic:

Example of “discharge” command wanting to discharge 2000 watts:

![image](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/8/7/872265373785d876a4a13ffce8219bfef2ade46c.png)

keep in mind to change to your correct IP number as well as copy/pasting your unique API-token where I’ve written “PASTETOKENHERE”

---

<div class="post-metadata">

**Author:** ![Kim\_Kokholm](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/kim_kokholm/32/91519_2.png) [@Kim\_Kokholm](https://community.homey.app/u/Kim_Kokholm)\
**Post date:** [November 19, 2023, 7:20pm UTC](https://community.homey.app/t/sonnen-battery-api/54658/23 "2023-11-19T19:20:20Z")

</div>

Hi Fellow-Homey-users

I’ve just pushed an app: [Sonnen Batterie App til Homey | Homey](https://homey.app/da-dk/app/com.sonnen.battery/Sonnen-Batterie/)

I’ve been adressing ToC (Time Of Consumption), with the ability to Pause ToC, Reset ToC and create Schedule for ToC.

Feedback appreciated.

---

<div class="post-metadata">

**Author:** ![Kim\_Kokholm](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/kim_kokholm/32/91519_2.png) [@Kim\_Kokholm](https://community.homey.app/u/Kim_Kokholm)\
**Post date:** [November 19, 2023, 7:21pm UTC](https://community.homey.app/t/sonnen-battery-api/54658/24 "2023-11-19T19:21:11Z")

</div>

I’ve been trying to solve/address this, excatly this.

> **[Sonnen Batterie](https://homey.app/da-dk/app/com.sonnen.battery/Sonnen-Batterie/)**
>
> Clean and affordable energy for everyone.

---

<div class="post-metadata">

**Author:** ![Inquisitor](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/inquisitor/32/95119_2.png) [@Inquisitor](https://community.homey.app/u/Inquisitor)\
**Post date:** [December 21, 2023, 8:04am UTC](https://community.homey.app/t/sonnen-battery-api/54658/25 "2023-12-21T08:04:43Z")

</div>

Hi,

Great app!  
One thing I notice is that if I create a ToU schedule, it removed whatever schedule I have previously set. In the Sonnen dashboard it is possible to have more schedules for a day. Is this possible to have support for setting more schedules in the Homey app?

/Martin

---

<div class="post-metadata">

**Author:** ![KD\_Kruger](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/kd_kruger/32/78996_2.png) [@KD\_Kruger](https://community.homey.app/u/KD_Kruger)\
**Post date:** [June 13, 2024, 10:09am UTC](https://community.homey.app/t/sonnen-battery-api/54658/26 "2024-06-13T10:09:46Z")

</div>

Hi, van I use your App also with my Sonnenbatterie Ver. 6. I also use the actual sonnen App . Thanks

 ![IMG_4512](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/b/0/b0500aaf9b20ce056e5a496b0d470ca6ff1b7008.jpeg)

---

<div class="post-metadata">

**Author:** ![Marc\_Iven](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/marc_iven/32/82278_2.png) [@Marc\_Iven](https://community.homey.app/u/Marc_Iven)\
**Post date:** [August 23, 2024, 3:36pm UTC](https://community.homey.app/t/sonnen-battery-api/54658/27 "2024-08-23T15:36:37Z")

</div>

Hi Kim,

I’ve been using your App for a while now and it works great.

I’ve a feature request: is it possible to create a command to set TOU with also the starting time configurable by tag.

This would alow to schedule at variable hours, when needed.

It’s quite similar with already existing command.

 ![Screenshot_2024-08-23-17-18-22-07_4bbfc4a7dd885a2bb189f300112a7ed4](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/0/4/046c097a2f66a7e19718abf2d5cc9de39c3b6f31.jpeg)

Thanks.

---

<div class="post-metadata">

**Author:** ![Kim\_Kokholm](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/kim_kokholm/32/91519_2.png) [@Kim\_Kokholm](https://community.homey.app/u/Kim_Kokholm)\
**Post date:** [August 23, 2024, 5:37pm UTC](https://community.homey.app/t/sonnen-battery-api/54658/28 "2024-08-23T17:37:04Z")

</div>

Hi, I am looking for a way add apply hours as a parameter. I did not succeed.

I think I did a variant with +hours instead of hour-format.

Do you by chance know of a app/flow, that allows input for “hour-format”?

---

<div class="post-metadata">

**Author:** ![Marc\_Iven](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/marc_iven/32/82278_2.png) [@Marc\_Iven](https://community.homey.app/u/Marc_Iven)\
**Post date:** [August 23, 2024, 9:17pm UTC](https://community.homey.app/t/sonnen-battery-api/54658/29 "2024-08-23T21:17:09Z")

</div>

Hi Kim.

I did some research through google. Seems the api works like this:

curl -X PUT [http://192.168.0.130/api/v2/configurations](http://192.168.0.130/api/v2/configurations) -d “{"EM\_ToU\_Schedule":[{"start":"11:51","stop":"12:45","threshold\_p\_max": 46000}]}” -H “Auth-Token: xxx” -H “Content-Type: application/json”

What works on my SB10 from my win10 laptop.

Why not provide the hour-format as simple string, where user can provide “11:51” for start parameter in the sample above? This way you can use a homey time tag to set the string value. Combine this with the +hours variant and you can easily set the SB10 to load for 1 or more hours when grid prices are low.

You might ask why I’m asking for this functionality. It seems my SB10 only gets high charge when TOU start/stop period is small. When TOU configuration spans all day the charging goes very slow.

Diving deeper into your app today, I see I can solve this by creating 24h flows that have hardcoded hours and look for some app logic to select the correct flow, but I think this complicates things as my string solution covers all.

Regards,  
Marc.

---

<div class="post-metadata">

**Author:** ![Kim\_Kokholm](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/kim_kokholm/32/91519_2.png) [@Kim\_Kokholm](https://community.homey.app/u/Kim_Kokholm)\
**Post date:** [August 30, 2024, 7:50am UTC](https://community.homey.app/t/sonnen-battery-api/54658/30 "2024-08-30T07:50:47Z")

</div>

Hi @Marc_Iven

I can make a flow with string as input, where you put in 24-hour formatted values.  
Homey supports time as a parameter, and of my know-abouts it is not possible to provide a parameter without using the UI - if that makes sense.

Strings is possible.

What do you have in mind: start, stop and threshold right?

---

<div class="post-metadata">

**Author:** ![Marc\_Iven](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/marc_iven/32/82278_2.png) [@Marc\_Iven](https://community.homey.app/u/Marc_Iven)\
**Post date:** [August 30, 2024, 8:09am UTC](https://community.homey.app/t/sonnen-battery-api/54658/31 "2024-08-30T08:09:00Z")

</div>

Hi Kim,

Most easy would be to have

- start (string)
- hours (number)
- threshold (number)

You have already implemented a function like that, but not with start as string instead hour/min sliders.

Greetz,  
Marc.

---

<div class="post-metadata">

**Author:** ![Kim\_Kokholm](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/kim_kokholm/32/91519_2.png) [@Kim\_Kokholm](https://community.homey.app/u/Kim_Kokholm)\
**Post date:** [September 21, 2024, 8:38am UTC](https://community.homey.app/t/sonnen-battery-api/54658/32 "2024-09-21T08:38:53Z")

</div>

Hi @Marc_Iven

For further assistance, please use the thread: [[APP][Pro] Sonnen Batterie](https://community.homey.app/t/app-pro-sonnen-batterie/96052)

[Previous page](https://community.homey.app/t/sonnen-battery-api/54658.md?page=1)
