datMaffin / homebridge-tesla-powerwall

Homebridge Plugin for the Tesla Powerwall
ISC License
21 stars 11 forks source link

Change operation Mode #45

Open BMWE85 opened 1 year ago

BMWE85 commented 1 year ago

Hello, thank you for all your efforts to write this Plug-In for Homebridge. Is it possible to integrate an additional function to change the operation Mode? I like to change from autonomous (aka Time of Use (TOU)) and self_consumption and back via HomeKit. Unfortunately I don't know how to do it by myself :-(

Thank you very much.

GET /api/operation

request: curl --header "Authorization: Bearer OgiGHjoNvwx17SRIaYFIOWPJSaKBYwmMGc5K4tTz57EziltPYsdtjU_DJ08tJqaWbWjTuI3fa_8QW32ED5zg1A==" https://192.168.xxx.xxx/api/operation

response: {"mode":"self_consumption","backup_reserve_percent":15}

POST /api/operation

The below request would set the battery mode to "Self-powered" and a "Reserve for Power Outages" to 20% (app value) using the token retrieved from the authentication example.

request: curl --header "Authorization: Bearer OgiGHjoNvwx17SRIaYFIOWPJSaKBYwmMGc5K4tTz57EziltPYsdtjU_DJ08tJqaWbWjTuI3fa_8QW32ED5zg1A==" -X POST -d '{"mode":"self_consumption","backup_reserve_percent":24.6}' https://192.168.xxx.xxx/api/operation

response: {"mode":"self_consumption","backup_reserve_percent":24.6}

Valid Modes:

self_consumption backup autonomous (aka Time of Use (TOU) as reported by dlieu on the teslamotorsclub.com forums) scheduler aka Aggregation - This seems like it is not supported now.

datMaffin commented 1 year ago

This looks similar to #15 and is related to #37

I can see that functionality related to the api/operation is requested fairly often.

But no promises on when (or if) I get to it.