Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Add services for programming thermostats #246

Merged
merged 1 commit into from
Jan 20, 2025

Conversation

ocrease
Copy link
Collaborator

@ocrease ocrease commented Jan 19, 2025

This PR attempts to add support for creating and editing profiles being requested in #109. There are some new services/actions:

  • Rename profile
  • Delete profile
  • Create/Update Profile (3 versions)
  • Create/Update Timer Profile (3 versions)

The services to create/update profiles have a version for 24hr mode, 5/2 day mode and 7 day mode. More details on how to use them have been added to the docs (you can see a preview on my fork - https://ocrease.github.io/Heatmiser-for-home-assistant/services.html)

There are a few new entities on the hub as well:

  • Profile Format - The profile format in use
    • Non Programmable - Heating profiles are not used
    • 24HR mode - the same profile levels every day
    • 5/2 Day mode - Different levels for weekdays and weekends
    • 7 Day mode - Different levels every day
  • Profile Alt Timer Format - Only populated if the main Profile Format is Non Programmable. This format would be used by timer devices
  • Profile Heating Levels - Specifies the number of levels on heating profiles. It can be 4 or 6. Timer profiles are unaffected by this, they always have 4 levels

This should go to a pre-release version (maybe 3.1.0-beta1?) so that people who are interested can try it out and feedback.

@mnbf9rca
Copy link

This is amazing, thank you. Could the services be named heatmiserneo.create_profile_24h, heatmiserneo.create_profile_52 and heatmiserneo.create_profile_7d to make them easier to identify?

Is it possible to “upsert” a profile? Like - I might want to push it daily to be sure it exists? Or I have to query for it first with heatmiserneo.get_profile_definitions?

@ocrease
Copy link
Collaborator Author

ocrease commented Jan 20, 2025

@mnbf9rca I guess I can change the validation so that when update=true it doesn't mind if the profile doesn't exist yet and therefore it would behave like upsert. Seems overkill to write it daily, does your hub lose profiles that often? As far as I know, only changing the format (24hr, 5/2 day, 7 day) and heating levels can cause the hub to delete existing profiles.

Regarding the names, in the action selector in HA you get a nicer name, but in code that's what you would need to use. Think of it as one set, two sets or 7 sets of levels.

@MindrustUK
Copy link
Owner

@ocrease I'll wait for further actions before merging on this one, looks like there's still some discussion going on.

@ocrease
Copy link
Collaborator Author

ocrease commented Jan 20, 2025

@MindrustUK I think you could merge so people can try it out and provide feedback. There will be more PRs for sure.

@MindrustUK MindrustUK merged commit 099a513 into MindrustUK:dev Jan 20, 2025
2 checks passed
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants