I wanted to share my recent success in setting up a smart automation for my guest bathroom water heater. After some trial and error, I finally got everything working smoothly!
Initially, I tried a simple setup where I would turn on the heater and send a Telegram notification. But I noticed an issue where the switch wouldn’t turn on, even though I received the message. I decided to test the code by adding multiple services to see if the problem was with the switch itself.
Here’s what I learned:
-
Multiple Services Can Be Triggered - I was able to successfully chain multiple actions in a single automation. This means you can combine notifications, switch toggles, and even other services in one flow.
-
Order Matters - I found that placing the switch toggle at the beginning of the action list was crucial. If I put it after the notifications, it didn’t work as expected.
-
Testing Is Key - By isolating each part of the automation, I could pinpoint exactly where the issue was. This saved me a lot of frustration and helped me refine the code.
Here’s the final code that worked for me:
yaml
- alias: ‘Turn ON Bath2 Water Heater every weekday evening’
trigger:
platform: time
at: ‘21:40:00’
condition:
condition: time
weekday:
- mon
- tue
- wed
- thu
- fri
- sat
- sun
action:
service: switch.turn_on
data:
entity_id: - switch.bath2_water_heater
service: telegram_bot.send_message
data_template:
title: ‘HA Alert!’
target: ‘142454348’
message: ‘Guest bathroom water heater turned ON for the evening cycle.’
This setup now reliably turns on the water heater every evening and sends me a notification. It’s been running smoothly for weeks now!
If anyone else is working on similar automations, I’d love to hear about your experiences or tips. Happy automating! ![]()