Skip to content
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

Modified to work on 0.91.2 and added functionality #1

Merged
merged 6 commits into from
May 27, 2019

Conversation

CoMPaTech
Copy link
Collaborator

Not sure if the heater 'on' detection works, but will try that in the coming days. If you rather put that in haanna that would be better I guess, or now I've put the generic idea here as I still have to tinker with it.

The current code doesn't seem to work under HASS 0.91.2, this PR solves that for me.

Great work, got Anna today and already loving it (in HASS!)

Also addded display of the current preset (home/away/asleep) - are you thinking of including this component in HASS itself? Updating https://community.home-assistant.io/t/advice-how-to-load-sensor-info-from-plugwise-anna-thermostat-web-interface-xml/87801/4 to have the community check on this as well.

Feedback is welcome!

@CoMPaTech
Copy link
Collaborator Author

btw: reason for renaming the directory in custom_components is alignment with the changed naming scheme for custom_components

@CoMPaTech
Copy link
Collaborator Author

Schermafbeelding 2019-04-24 om 07 49 14
Detecting heating works too (as included in the PR)

@CoMPaTech
Copy link
Collaborator Author

Beware that I 'assumed' haanna to be at 0.6.2 or something likewise in both files (preparing for upstreaming to main homeassistant later on). After these commits I'll submit a PR for https://github.com/laetificat/haanna as well!

Added some more changes to have more features available, also heating display definitely works (state on/off = heating status, operation mode is if schedule is active).

Although shown, operation mode can't be switched just yet. Using service climate.set_hold_mode works to switch presets. climate.set_operation_mode is on the todolist.

For those reading along, I only have a Honyewell valve-switch on 'city-heating' infrastructure, so I'm on "on/off" territory.

@CoMPaTech CoMPaTech changed the title Modified to work on 0.91.2 and added hold_mode (i.e. presets) Modified to work on 0.91.2 and added functionality Apr 24, 2019
@CoMPaTech
Copy link
Collaborator Author

(the reference to renaming the directory is towards https://developers.home-assistant.io/blog/2019/04/12/new-integration-structure.html - still work to be done as well for upstreaming)

@laetificat
Copy link
Owner

Thanks for your pull request.

I'll check it out asap, I'll have to update my environment and test it myself since my Anna has not had much use lately.

Regarding including this component to HASS: it would be great to have it in the core but I think this project is still too fragile. I'd like to get this component as close to the silver quality integration as possible. It still need tests and async loading.

@CoMPaTech
Copy link
Collaborator Author

No problem @laetificat - found it while ordering it last week and extremely happy with all the work you already performed on it and would love to help out with getting it up to par. When you have time let me know what you think of the additional features. If time allows I might still add the set_operation in - if need be we at least have functioning code and can rework things before adding tests and doing the async loading (the latter I really have to look into).

import homeassistant.helpers.config_validation as cv

SUPPORT_FLAGS = SUPPORT_TARGET_TEMPERATURE
SUPPORT_FLAGS = ( SUPPORT_TARGET_TEMPERATURE | SUPPORT_OPERATION_MODE | SUPPORT_HOLD_MODE | SUPPORT_AWAY_MODE )
Copy link
Owner

@laetificat laetificat Apr 27, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Operation mode and away mode have no implementation. Using any of these options returns errors.

I'm not sure what operation mode is supposed to do, the HASS docs say "Operation mode to set temperature to. This defaults to current_operation mode if not set, or set incorrectly.", but isn't this already achieved by using the hold mode?

I'm also not able to set the hold mode at the moment, there is no option to select "home", "vacation", etc.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Operation mode I was looking into to switch schedules, but it's a little more difficult (I know how to activate them again, but there is your custom (or more?) schedule and the learning schedule. Not sure though like you state if using operation mode for that is the best.

Hold mode can be set but the way hass-climate seems to have this done is using service climate.set_hold_mode.

On changing the support flags, good call - I shouldn't have left the partials in - but not sure either on the implementation.

Hold-mode - seems legit for home/vacation etc. - works using the service call
Operation-mode - was looking into (ab)using this for schedule on/of
Away-mode - the device supports it, but I recon me only having it put up it still needs to 'learn', the way the docs of plugwise state it they use geofencing on their app for this? (Not sure if I particularly like it)

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Commented these out until we have a decision on how to go from here (code is still in, but not advertising them)

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One way could be to use 'presets' as 'operation_mode' so users can adjust it from the UI directly and either not bother about the schedules or move those as 'hold_mode'. The way I read the code-comments, code-issues and some on the forum is that hold_mode is about retaining temperature at a set (i.e. hold) point, therefor our presets of Anna would align on hold_mode, right? Question would (or can) be, how (or if) we want to bother with being on schedule or not.

custom_components/anna/manifest.json Outdated Show resolved Hide resolved
custom_components/anna/__init__.py Show resolved Hide resolved
laetificat and others added 2 commits April 28, 2019 09:35
Remove breaking dependency

Co-Authored-By: CoMPaTech <CoMPaTech@users.noreply.github.com>
@CoMPaTech
Copy link
Collaborator Author

Code pushed, operation_mode vs hold_mode still open although the first is removed as being actively advertised from the code (together with away_mode). Added to the documentation how to activate hold_mode (i.e. service-call to climate.set_hold_mode) and added checks on validity of these modes (along with validating temperature).

@CoMPaTech
Copy link
Collaborator Author

@wburgers
Copy link

Another ping 😇, would love to see this working in home assistant!

@CoMPaTech
Copy link
Collaborator Author

@laetificat any option for you to make some time available? Or otherwise allow access to the repo, not really looking forward to forking as indicated by the community, especially on things already committed through PyPi

@laetificat laetificat merged commit 5e5c1b7 into laetificat:master May 27, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants