WThermostatBeca
WThermostatBeca copied to clipboard
Feature Request: Virtual Relay Control
Appreciate you've recently added a virtual relay status to show whether the device is idle or actively calling for heat. I was wondering whether it would be possible to build-in a 'virtual relay control' (i.e. overriding setpoint for a pre-defined period/ until a 'relay off' command is received).
My use case is that I'd like to use TRV/ external wireless temperature sensors in different rooms (in the same heating zone/ responsible Wi-Fi thermostat) to initiate a call for heat (relay ON, via MQTT), and when the remote TRV target is reached (relay OFF, via MQTT) the Thermostat returns to its previous state in terms of target temperature.
I can manage Thermostat grouping (OR group/ logic to ensure that if a single TRV/ room has demand the call for heat occurs) in Node-RED/ Home Assistant, it's just control of the relay itself I am looking for (and trying to avoid putting a Shelly1 in series/ parallel to the Wi-Fi thermostat).
Hopefully that makes sense... !
I think this could be done with a hardware hack.
The exiting hardware hack just reads the relay state (if wired correctly to the wire that feeds the base of the transistor that turns on the relay), but, if there is another GPIO available to use, we could use that to control an NPN transistor wired to a PNP transistor which would send 5 volts down the wire that feeds the base.
The PNP transistor can switch 5 volts on and off, but it needs a ground signal to do so, provided by the NPN transistor, which is controlled by the ESP module.
This would directly control the relay, so the built-in control from the MCU wouldn't know the relay state, but if either call for heat it will be provided.
The major downside I can see to this is if the manual control gets turned on and not turned off, there is no safety net to turn it back off. Maybe a simple timer in the code would suffice?
Message to comment on stale issues. If none provided, will not mark issues stale