-
Notifications
You must be signed in to change notification settings - Fork 31
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Actions! #73
Actions! #73
Conversation
Signed-off-by: stefan <stefan@whocares.de>
Signed-off-by: stefan <stefan@whocares.de>
actions. Currently supported are: - `set_operating_mode(mode=<mode>)` - `charge_battery(power=<power>)` - `discharge_battery(power=<power>)` - `set_battery_reserve(value=<value>)` - `set_config_item(item=<item>, value=<value>)` - `set_tou_schedule(schedule=<schedule_array>)` - `get_tou_schedule()` Signed-off-by: stefan <stefan@whocares.de>
Signed-off-by: stefan <stefan@whocares.de>
Signed-off-by: stefan <stefan@whocares.de>
Signed-off-by: stefan <stefan@whocares.de>
I published https://pypi.org/manage/project/sonnenbatterie/release/0.5.0/ :) |
Signed-off-by: stefan <stefan@whocares.de>
@weltmeyer |
Signed-off-by: stefan <stefan@whocares.de>
Oh, and please take your time testing this. I might have broken things when switching to "fully asynchronous". |
Fresh HAOS install, errors right after setup
|
Signed-off-by: stefan <stefan@whocares.de>
Should be fixed now, together with some other minor stuff. |
|
Also try some re-configuration, like for example changing the scan interval. Works fine for me but you never know ... |
Uhoh, I think that's more a problem with |
Yup, at least for me it was a problem with |
Signed-off-by: stefan <stefan@whocares.de>
updated and restarted and in testing :) |
Ahh i see its not meant to select a device. (What if i have multiple sonnenbatteries?) So the service returns an error for me:
|
Unfortunately I can't deduce from the snippet what action you tried to run. I'll look into the device id issue. |
it was "Sonnenbatterie: Get charging schedule" |
- Properly support device selection on actions (device_id is now mandatory!) - Support multiple SonnenBatterie instances (I even tested this ;)) Signed-off-by: stefan <stefan@whocares.de>
Multiple SonnenBatteries are now supported
Fixed - unfortunately with yet another PR to |
Signed-off-by: stefan <stefan@whocares.de>
Get charging schedule is working now.
this resulted with a 401:
i have NEVER used these functions on my battery, so i am not sure if it should work or not. Also the bat is at 0% currently so this could be just some generic API error |
Nevermind, the 401 is resolved by enabling/allowing write-operations in the batterie. Maybe we should inform the user about this :) |
/api/json_api/json_api_configuration contains the api configuration state:
/api/json_api/local_write allows setting the values (disable IN_LocalAPIWriteActive) :
|
I'll let this Version of the PR run until tomorrow and if it doesn't stall on the value-updates we can merge it,imho. |
Signed-off-by: stefan <stefan@whocares.de>
I'd like to add two more actions: |
I'll wait these actions then. Maybe we can just if API is enabled in case of 401 to show a more describing error message.
I first need to understand how actions work from your code to be able to write this by myself.. you may be faster at implementing this :) |
I so love the logic of Sonnen. The Write API is accessible only from the v2 API. But to check whether the Write API is enabled you have to use the API v1 - and of course the respective credentials. Jeez. I'll have to think about this.
I'd rather not provide that. Enabling the API should be a decision the user has to make and set it on the device. (imho)
Actually, that's fairly easy:
=> You're done ;) |
- `get_battery_reserve` - `get_operating_mode` > [!WARNING] > Untested since I'm on the road Signed-off-by: Stefan Rubner <stefan@whocares.de>
Happy New Year :) For me it looks like everything is working If you don't have anything you want to change you can undraft this PR . |
To you too!
It's undrafted ;) Keeping my fingers crossed. |
Actions!
Warning
This version of the integration needs python_sonnenbatterie >= 0.5.0 (see this PR)
This is the first version of the integration to provide user facing
actions. Currently supported are:
set_operating_mode(mode=<mode>)
charge_battery(power=<power>)
discharge_battery(power=<power>)
set_battery_reserve(value=<value>)
set_config_item(item=<item>, value=<value>)
set_tou_schedule(schedule=<schedule_array>)
get_tou_schedule()