Having great frameworks like Home Assistant and ESPHome makes it simple to do simple things. It's like many other IRL infrastructure things that act as multipliers for add-on projects. There are lots of ways to accomplish this in those frameworks, and I'm using mechanisms that make the most sense to me.
For this project, I've chosen to make Home Assistant automation the centerpiece tying things together. The overall flow looks like this:
- Someone presses one of the buttons.
- Home Assistant detects that button press as a trigger for an automation.
- Home Assistant "presses the button" that momentarily activates the relay.
- Home Assistant turns on the LED on the D1 Mini.
- The water heater starts the recirculation pump.
- Home Assistant calls the "set_led_hot" service on each Atom device.
- A timed delay happens.
- Home Assistant turns off the LED on the D1 Mini.
- Home Assistant calls the "set_led_cold" service on each Atom device.
The timed delay isn't the greatest situation. It means that Home Assistant has to know the timer configuration for the recirculation pump on the water heater. I'm hoping to eventually figure out a way of detecting if the pump is actually running and use that instead of a timer. I have plenty of spare GPIOs on the D1 Mini to use for that.
I've only got one Atom configured right now. Additional devices will be added to the triggers, along with the button on the D1 Mini. Here's what the automation looks like (the timeout is temporarily set to 15 seconds for testing purposes):
alias: Tankless hot button description: Press the button, get hot water trigger: - platform: state entity_id: - binary_sensor.hotbuttonkb_button from: "off" to: "on" - platform: state entity_id: - binary_sensor.hotbuttonrelay_button from: "off" to: "on" condition: [] action: - type: turn_on device_id: 631ea0d418d7508fdbf35e046f077906 entity_id: 556da559467ce707e6dd9f6c5ad39797 domain: switch - type: turn_on device_id: 631ea0d418d7508fdbf35e046f077906 entity_id: 2a370e76eeb5971f48e70e2f75f500e7 domain: switch - service: esphome.hotbuttonkb_set_led_hot data: {} - delay: hours: 0 minutes: 0 seconds: 15 milliseconds: 0 - service: esphome.hotbuttonkb_set_led_cold data: {} - type: turn_off device_id: 631ea0d418d7508fdbf35e046f077906 entity_id: 2a370e76eeb5971f48e70e2f75f500e7 domain: switch mode: restart
The device and entity IDs in the YAML make it a little tricky to see what's going on, so here is a GUI screenshot of the same automation:

Discussions
Become a Hackaday.io Member
Create an account to leave a comment. Already have an account? Log In.