I grew tired of manually setting charging-schedules for my home battery via SMA´s Sunny Portal.
If you are like me (and are familiar with Linux), good news!
My brother has programmed an adapter that runs on Linux that accepts commands from Homey via the “then” logic-card “Make a method request to URL with headers and body”.
The adapter then automatically log-ins to Sunny Portal and clicks it ways through PV System Properties->Parameters and sets the charging schedule that you typed in the logic-cards body.
The project is free to use at GitHub:
Sunny Adapter
Directions of Homey-usage:
(Please read the README @GitHub for howto about the adapter
-
Create your favorite automation flow.
-
Select the “Then” Logic-card “Make a method request to URL with headers and body”.
Type your URL in the URL section.
Example: http://localhost:3000/plants/granstugan/battery/time-window -
Select PUT in method section.
-
Type the below header in the header section
(replace apiAccessPassword with your chosen password for the adapter)
Authorization: Bearer apiAccessPassword
Content-Type: application/json
Note: The headers must be separated with a new row as stated in the example abow. -
Type your command string in the body section.
Example 1:
[{ “start”: “11.00”, “stop”: “+1h”, “power”: 1000 }]
(Creates a time window start charging at 11:00, stops charging with offset 1 hour ie 12:00 with charging power 1000 watts)
Example 2:
[ ]
(Deletes all schemes)
Example 3:
[{ “start”: “14.00”, “stop”: “16:00”, “power”: 0 }]
(Creates a time window start charging at 14:00, stops charging at 16:00 with charging power 0W which effectivly stops the battery from both charging and discharging)
Example 4:
[{ “start”: “11:00”, “stop”: “12:00”, “power”: 2000 }, { “start”: “13:00”, “stop”: “+5h”, “power”: “5000”}, {“start”:“19:00”, “stop”:“00:00”, “power”: 0 }]
(Creates multiple time windows with different types)