-
-
Notifications
You must be signed in to change notification settings - Fork 30.4k
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
Update overkiz Atlantic Water Heater away mode switching #121801
Update overkiz Atlantic Water Heater away mode switching #121801
Conversation
Hey there @iMicknl, @vlebourl, @tetienne, @nyroDev, @Tronix117, mind taking a look at this pull request as it has been labeled with an integration ( Code owner commandsCode owners of
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks again for your contribution! Some initial questions.
...onents/overkiz/water_heater_entities/atlantic_domestic_hot_water_production_mlb_component.py
Outdated
Show resolved
Hide resolved
...onents/overkiz/water_heater_entities/atlantic_domestic_hot_water_production_mlb_component.py
Outdated
Show resolved
Hide resolved
Hi! Sorry to be bothering, I see the PR was approved last month, is it ready to be merged? :) |
@ALERTua There's a merge conflict, can you fix it? |
done |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, @ALERTua 👍
../Frenck
Breaking change
Proposed change
Based on #114184, changes the way the away mode is switched on for the Atlantic Water Heaters, setting
setAbsenceStartDate
andsetAbsenceEndDate
before switching on the away mode.Alas, the initial functionality with just switching the away mode
on
has some kind of rechecks on the Cozytouch server, and the away mode keeps getting switched off on the server side due to the start and end dates being incorrect (past dates). This change corrects this behavior, making the switch consistent with the Cozytouch mobile application behavior.The API uses two different away mode states:
on
andprog
, but based on @sippe2 testing, those states have the exact functionality, so for the sake of consistency within the HA code, theon
state is left to be used. This behavior may be changed if core maintainers wish so.Here are @sippe2 tests for
on
andprog
away modes:Image tl;dr:
on
andprog
are the same,setAbsenceStartDate
needs to be set beforehand withnow
or the future,setAbsenceEndDate
needs to be set beforehand and to be in the future, only thenon
orprog
away modes may be set.The way the API accepts setting dates is based on the original
core:DateTimeState
state for the DHW that returns a dict (like this{'day': 11, 'hour': 21, 'minute': 12, 'month': 7, 'second': 53, 'weekday': 3, 'year': 2024}
), the dict is then passed as a start date, and then as an end date, but with year incremented by 1. The weekday seems to have no effect, and I didn't want to calculate the future date correct week day, but I can base all the dates on homeassistantdt_util
and form those dictionaries from scratch based ondatetime.now()
anddatetime.timedelta
into the future if core maintainers wish so.In my recent tests I discovered that
core:DateTimeState
device state does NOT have a consistent current datetime. I have found that the datetime gets lost after power outages, so in order to correctly set away start and end dates, thesetDateTime
command should be called to set thecore:DateTimeState
state of the device to the current datetime before setting the away start and end dates.Also, changes the way to determine that the away mode is turned on by checking that the value is
on
orprog
, which is consistent with the API and the mobile application.Also, the commands executor now accepts an optional argument
refresh_afterwards
, that allows sending multiple commands without refreshing after each one, and then finally refreshing afterward. This fixes the device briefly going 'unavailable' when sending multiple commands as in switching the away mode on.Uses the new Overkiz API fields. Related PRs:
iMicknl/python-overkiz-api#1293
iMicknl/python-overkiz-api#1294
If you are reading this while there are the hardcoded command names, I will update them to the pyoverkiz fields as soon as the PR above is released.
The code was tested on Atlantic Steatite Cube WI-FI VM 150 S4CS 2400W.
The ongoing plan for this PR:
Type of change
Additional information
Checklist
ruff format homeassistant tests
)If user exposed functionality or configuration variables are added/changed:
If the code communicates with devices, web services, or third-party tools:
Updated and included derived files by running:
python3 -m script.hassfest
.requirements_all.txt
.Updated by running
python3 -m script.gen_requirements_all
.To help with the load of incoming pull requests: