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

Added support for controlling a second relay for cooling. #441

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

HarmEllis
Copy link

I wanted to control heating and cooling from Home Assistant.

This change adds a second switch in Home Assistant, named 'switch.altherma_cooling', but only if the 'PIN_COOL' is defined in the 'setup.h' file.

The logic will prevent from switching heating and cooling on at the same time (although a Daikin Altherma Hybrid will prever heating over cooling if both are enabled). When switching cooling on while heating is on, heating will be turned off and vice versa.

I also refactored the 'callbackTherm' function to prevent duplicate code, since there can be two relays to control now.

I had one issue with this, it seems like somehow this inverts the relay active state. I changed mine from HIGH to LOW in 'setup.h' and after that everything was working properly. I could not find out why this changed though. Maybe someone else can test and confirm this behavior.

Also, I do not have a lot of c/ c++ or mqtt experience, feedback is always welcome!

Refactored the callbackTherm function to prevent duplicate code.
@philipgo
Copy link

philipgo commented Oct 9, 2024

@raomin Will this be merged or do you have objections?

@raomin
Copy link
Owner

raomin commented Oct 10, 2024

I just need a bit of time to have a look at it.
Thanks @HarmEllis already,
@philipgo did you try it?

@philipgo
Copy link

Sorry, no pressure! I just wondered whether there are any fundamental objections from your side. No, I have not tried it yet, still waiting for the delivery of my second relay.
@HarmEllis What hardware do you use with the 2-relay-setup?

@HarmEllis
Copy link
Author

I use an ESP32-wroom with a two channel 5V relay. I have both soldered on a small prototype board with four plastic spacers on the bottom, this fits nicely behind the water pump. The heat pump supplies enough voltage for the esp and relay to switch it on and off without issues.

I have used part of some power cable I had lying around to connect the relay to the heat pump. Note that the voltage will be 110v or 220v, at least for my hybrid heat pump, it is not a low voltage signal, so use appropriate cabling and be careful.

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.

4 participants