Display SwitchBot controlled Central heating mode in HA?

I have a Central Heating boiler with a fairly dumb digital timer/programmer. In an attempt to provide some level of automation to it, I have fitted a “SwitchBot Bot” device (see SwitchBot Bot - The Iconic Button Presser – SwitchBot Global) to the front of the panel so I can use Bluetooth control to ‘push’ one of the control buttons on the timer/programmer to turn my Central Heating on/off.

However, the button on the timer/programmer I’m controlling by SwitchBot (marked ‘SELECT’ to allow manual user selection of the Heating mode), has 4 possible modes (OFF, TWICE per day, ONCE per day, ON) which it just cycles through on each press of the SELECT button.

I’ve added the ‘Switchbot_press’ integration via HACS (see GitHub - cagnulein/switchbot_press: This is a simple project that manage the Switchbot ( https://amzn.to/3dnliBD ) that has only the "press" ability in Home Assistant.) and it’s working fine.

But I’m wondering how I can implement some kind of switch in HomeAssistant that indicates which of the 4 modes should be the current mode selected on the boiler? I just want some kind of display value in HomeAssistant that cycles through OFF>TWICE>ONCE>ON every time I press a button in HomeAssistant so that I can know which mode the boiler ought to be in (there’s no sensor feedback from the boiler programmer or from the SwitchBot, so I don’t actually know which mode it is really in, only which mode it ought to be in based on strict cycling through the 4 modes).

I thought about an ‘input_select’ in HomeAssistant, but that’s not really what I want as it allows selecting the modes in any sequence, whereas my boiler timer/programmer must cycle in strict sequence OFF>TWICE>ONCE>ON.

What’s the best way to have HomeAssistant indicate on a panel, the mode selected on my boiler after each press of my SwitchBot button in HomeAssistant?

What happens when you kill power to the thermostat and power it back on? Does the mode retain it’s past setting or does it always default to off?

I’ve not actually tried killing the power to the timer, as don’t want to risk it dying on me unnecessarily. It’s battery-backed, so I imagine when power is restored, it simply resumes status as per the time-of-day it’s been programmed for. It’s not a room thermostat, it’s just an on/off timer.

But this doesn’t affect how to represent its current mode in HomeAssistant - I just need a way to show a colour or bit of text to represent the OFF>TWICE>ONCE>ON mode and update it everytime I press the SwitchBot button. Obviously if SwitchBot fails to work, then the HomeAssistant indicator wouldn’t then match the actual boiler timer mode - that’s the risk I’ll have to take, unless anyone has an idea for ‘sensing’ if my boiler is on or off? I thought about a camera, but the boiler is in cupboard & it’s dark in there.

Nobody got any suggestions for how to implement an OFF>TWICE>ONCE>ON indicator in HomeAssistant that I can update whenever my SwitchBot button is operated?

Curious if you ever found a solution you like? I’m implementing something similar. My strawman is a dummy sensor value that I increment and modulo on every press.

For example, if my device has four states, I’d do something like:

current_sensor_value = (current_sensor_value + 1) % 4

Then manually map the sensor values to strings whenever necessary for display.

If the counter ever gets out of sync with the state of the physical device, I’d need to reset the sensor to the correct state to match reality

No, I never found a solution. I just have to remember what mode the boiler is in & what mode it’s switching to when I operate SwitchBot. It does help that I can generally hear when the boiler fires-up & starts producing hot water.

Does your modulo 4 idea work? How do you implement that in the configuration.yaml ? How do you create a ‘dummy sensor’ & where do you modify its value? in an automation?

are you having problems with the new switchbot integration?! my bot turns unavailable after few minutes and doesn’t recover… thanks

Yes, it doesn’t seem to work as well as the old custom integration.

If I try to ReLoad the new integration, I get a configuration error which says:

“Retrying setup: Could not find Switchbot bot with address xx:xx:xx:xx:xx:xx”

even although it generally seems to work for a while after restarting HomeAssistant.

I think it’s probably the issue discussed here:

thanks, i missed it… the winter season is here, let’s wait few days… than i’ll have to put on the old components

If you mean the “old” SwitchBot Press integration available here:

then I don’t think it works anymore (unless it was updated recently?)

I’ve updated to Home Assistant 2022.9.5 this morning, and completed a ‘sudo apt update/upgrade’ & reboot, and my SwitchBot integration (the new one, not the old custom switchbot_press) seems to be remaining connected okay.

So now just need a method (perhaps the modulo 4 ‘dummy sensor’ ?) to reflect the setting of my central heating mode as controlled by my SwitchBot Press device.

I havent given it a try yet (modulo trick), will update this thread when I get around to it in the next couple weeks