Closed xalex75 closed 2 years ago
There are 2 types of relay:
You probably have a NC one. But have a look as some has 2 possible mode/connectors.
I would advice against using NC, but as a failure would turn your heat pump always on...
If you still want to invert the mode, just replace all HIGH to LOW and vice versa where you see
digitalWrite(PIN_THERM,
It has a jumper, but if I move it, it doesn' switch anymore. So I think that changing it in code would be better, or change relay. Thank you, I will try.
Edit: my relay will not be used to turn on/off heating, but to put the machne in summer mode during the winter nights (so it just does ACS if needed), so a failure should be a smaller problem. Can I please ask you in which files is that? I only found a "digitalWrite(PIN_THERM, HIGH);" in main.cpp, changed it to LOW and reflashed, but looks nothing changed. Sorry, first time playng with platformio and VSC
I bought new relay, I prefer not changing code too much, so fure update will be easier. It will arrive tomorrow, I hope that it will act correctly 😉
Hi. New different relays arrived, but these are active in inverted mode too. When switch is on they are off and viceversa. I think that I will create an inverted template switch in HA, if I'm the only one experiencing this.
Hi @xalex75 Can you share your link to/picture of the module you bought. Normally they all have 3 wire connector: one for the NC, one for the NO (and one for the COM)
Turn it around and check.
Hi. I think there's a misunderstanding. I know that I can use NC o NO contacts. What I mean is the tin my case when switch.alterma is off, the relay is active, when it's on, the relay is not active. Maybe it depends on the gpio used on Esp32 cam, I don't know, but I fixed that with a switch template in HA that has inverted state compared to switch.altherma.
There seems to be some inconsistency after reboots, but I have to check it better.
I'm still trying to use the switch in a reliable way. Let's start from a situation with relay off. When I reboot HA, the switch is in unknown state:
and the switch button in lovelace is shown as off. If I click it, the entity state changes from unknown to off, and in lovelace it correctly shows it as off, but the relay goes on. If I click it again, lovelace shows it as on, and the relay goes off.
I created a template switch with inverted behavior compared to switch.altherma, and it would work if it was not for the unknown state after reboot, that makes the visible state in lovelace ureliable.
I'll try to get around this by testing the unknown state and activating automatically it one time to get the real state, it should work, but it look that there's some sort of malfunction in the switch part.
I notices thet in MQTT devices I see only althermasensor, not the switch. Is this correct? Thanks.
Ok, this is working for me. I tried to reboot with relay on and off and it keeps the state across reboots. "unknown" tate at boot is automatically changed to previous state.
So, all ok now @xalex75, I can close this?
Hi. Yes, I managed it in Home Assistant. Thanks.
Hi. I don't now why, but when the switch is off in HA, the relay is on, if I change the switch to on, relay goes off. I can't change it directly in the relay, how can I invert it in ESPAltherma? Thanks.