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

Fix Ephember cannot connect #140367

Draft
wants to merge 9 commits into
base: dev
Choose a base branch
from
Draft

Conversation

roberty99
Copy link

@roberty99 roberty99 commented Mar 11, 2025

Proposed change

Update library to pyephember2 to 0.4.3 which has MQTT fix for API version to use.
Moved from pyephember as owner is no longer active.
https://github.com/roberty99/pyephember2

Update Climate.py to remove unused calls and also fix the HotWater to always be device id 4.

Type of change

  • Dependency upgrade
  • Bugfix (non-breaking change which fixes an issue)
  • New integration (thank you!)
  • New feature (which adds functionality to an existing integration)
  • Deprecation (breaking change to happen in the future)
  • Breaking change (fix/feature causing existing functionality to break)
  • Code quality improvements to existing code or addition of tests

Additional information

Checklist

  • The code change is tested and works locally.
  • Local tests pass. Your PR cannot be merged unless tests pass
  • There is no commented out code in this PR.
  • I have followed the development checklist
  • I have followed the perfect PR recommendations
  • The code has been formatted using Ruff (ruff format homeassistant tests)
  • Tests have been added to verify that the new code works.

If user exposed functionality or configuration variables are added/changed:

If the code communicates with devices, web services, or third-party tools:

  • The manifest file has all fields filled out correctly.
    Updated and included derived files by running: python3 -m script.hassfest.
  • New or updated dependencies have been added to requirements_all.txt.
    Updated by running python3 -m script.gen_requirements_all.
  • For the updated dependencies - a link to the changelog, or at minimum a diff between library versions is added to the PR description.

To help with the load of incoming pull requests:

@home-assistant
Copy link

Hey there @ttroy50, mind taking a look at this pull request as it has been labeled with an integration (ephember) you are listed as a code owner for? Thanks!

Code owner commands

Code owners of ephember can trigger bot actions by commenting:

  • @home-assistant close Closes the pull request.
  • @home-assistant rename Awesome new title Renames the pull request.
  • @home-assistant reopen Reopen the pull request.
  • @home-assistant unassign ephember Removes the current integration label and assignees on the pull request, add the integration domain after the command.
  • @home-assistant add-label needs-more-information Add a label (needs-more-information, problem in dependency, problem in custom component) to the pull request.
  • @home-assistant remove-label needs-more-information Remove a label (needs-more-information, problem in dependency, problem in custom component) on the pull request.

@MartinHjelmare MartinHjelmare changed the title Ephember fix for issue #125374 Fix Ephember cannot connect Mar 11, 2025
Copy link
Member

@MartinHjelmare MartinHjelmare left a comment

Choose a reason for hiding this comment

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

Please read and fill in the PR checklist correctly according to what you have done. You're missing some required steps there.

@home-assistant home-assistant bot marked this pull request as draft March 11, 2025 18:42
@home-assistant
Copy link

Please take a look at the requested changes, and use the Ready for review button when you are done, thanks 👍

Learn more about our pull request process.

@roberty99
Copy link
Author

The owner of pyephember isn't online for a number of years. Can you advise on what's the best course of action to take ? My account has access on the pypi to update the package there but not the GitHub for it. > Please read and fill in the PR checklist correctly according to what you have done. You're missing some required steps there.

@MartinHjelmare
Copy link
Member

If you have tried to contact the original author, asking them to share or transfer maintenance to you, without success, I suggest you rename the package and publish it as a new project on GitHub and PyPI.

Give credit to the original author in the renamed project but publish it as a separate project, not a fork, since you're not planning to continue development of the original project.

We require 3rd party dependencies to make the source available in a public online code repository, eg GitHub, and releases published on PyPI should correspond to the releases on the public online code repository, such as GitHub.

@roberty99
Copy link
Author

roberty99 commented Mar 12, 2025 via email

@MartinHjelmare
Copy link
Member

Yes, that's ok.

@roberty99 roberty99 marked this pull request as ready for review March 12, 2025 09:28
@home-assistant home-assistant bot requested a review from MartinHjelmare March 12, 2025 09:28
Update Clime Platform Schema `homeassistant.components.climate.PLATFORM_SCHEMA` should be imported as `CLIMATE_PLATFORM_SCHEMA`RuffICN001
Copy link
Author

@roberty99 roberty99 left a comment

Choose a reason for hiding this comment

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

PLATFORM_SCHEMA as CLIMATE_PLATFORM_SCHEMA on line 22


OPERATION_LIST = [HVACMode.HEAT_COOL, HVACMode.HEAT, HVACMode.OFF]
OPERATION_LIST = [HVACMode.AUTO, HVACMode.HEAT, HVACMode.OFF]
Copy link
Member

Choose a reason for hiding this comment

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

Why do we change from HEAT_COOL to AUTO? The auto mode has specific meaning in Home Assistant.

# The temperature is set based on a schedule, learned behavior, AI or some
# other related mechanism. User is not able to adjust the temperature
AUTO = "auto"

Copy link
Author

Choose a reason for hiding this comment

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

In this case the thermostat will use the Schedule it has built in.

Copy link
Author

Choose a reason for hiding this comment

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

heat_Cool is never an option for Ember heating systems they are gas boilers.

Copy link
Member

Choose a reason for hiding this comment

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

Is it correct that the user can't adjust the temperature when in the AUTO device mode?

Choose a reason for hiding this comment

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

eTrv device and some thermostats can change temperature only in Manual/ON mode.
I think AUTO is more accurate mode. In AUTO mode devices use schedule and target temp.
Heat/Cool never exists in EPH devices.

Copy link
Member

Choose a reason for hiding this comment

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

We do not allow using auto mode if temperature can be changed by the user.

@home-assistant home-assistant bot marked this pull request as draft March 12, 2025 10:23
@roberty99
Copy link
Author

roberty99 commented Mar 12, 2025 via email

@MartinHjelmare
Copy link
Member

We can't use HVACMode.AUTO in Home Assistant if the user is able to change the temperature in that mode.

@roberty99
Copy link
Author

Screenshot_2025-03-12-14-05-26-80_a43fa3331b0de4f6ae70203555620ae1.jpg

The thermostat allows target temp change on Auto.
Auto dictates the timer schedule to use as opposed to Heat which is always on.

@roberty99
Copy link
Author

Screenshot_2025-03-12-14-06-59-92_a43fa3331b0de4f6ae70203555620ae1.jpg

@roberty99
Copy link
Author

I'm not a developer and am out of my depth committing these changes.
I'm only trying to help as this integration has been broken for 2 + years for the community and I've managed to get a working custom component functioning again with these small changes.

If we can't fix or support this can we just cancel the official EPHEmber support on HA and we move this to HACS instead ?

@MartinHjelmare
Copy link
Member

Is there a technical problem with keeping the device auto mode mapped to the HVAC.HEAT_COOL in the entity as it is today and has been for the last five years? If not, I'd suggest keeping it as such for now.

On another note: We have deprecated ClimateEntityFeature.AUX_HEAT.

https://developers.home-assistant.io/blog/2024/03/10/climate-aux-heater-deprecated

The aux heat on/off should be moved to a switch entity if separate control of that feature while the device is on is needed. If it's enough to be able to turn on/off the device the climate entity can support ClimateEntityFeature.TURN_OFF and ClimateEntityFeature.TURN_ON which can be set to allow the user to turn on/off the entity. When the entity is turned off, no other controls are possible, than to turn it on again.

Removing the aux heat feature can be done in a separate PR.

@roberty99
Copy link
Author

Heat/Cool: The device is set to heat/cool to a target temperature range.
I'll change to this method now and retest everything.

@roberty99
Copy link
Author

Using HVACMode.Heat_Cool you need to set High and Low temp range and the thermostat only accepts one target temp to reach. The UI is poor. HVACMode.AUTO is preferrably as we are setting the Thermostat to be Schedule controlled as per the documentation. I did not see why we cannot use AUTO with a target temperature.

@Zaduvalo
Copy link

I have complete this now as package pyephember2. If this is okay I will proceed to update the integration to use this package instead.

Do you think there is no chance to complete the version update in the original ttroy50 repo?
ttroy50/pyephember#19
Just prepare an updated version with new device support and small fixes

@roberty99
Copy link
Author

I can update PyPi directly for the pyephember package.Im a contributor there. I did it last week for version 0.4.1 with the mqtt API version fix. It just would be out of sync with its GitHub which is against HomeAssistant guidelines for pull requests.
Hence I've made Pyephember2 and we can use that and HA admins approved doing that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

components/ephember: Cannot connect to EphEmber
3 participants