<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/i-gave-my-smart-home-a-bedtime-button-and-it-actually-makes-every-night-a-little-bit-easier-1t68byctr" -->

---
title: I gave my smart home a bedtime button, and it actually...
description: A personal walkthrough describes building a single 'bedtime' automation that turns off lights, TVs, plugs, adjusts the thermostat, arms security, and enables...
canonical: https://daily.dev/posts/i-gave-my-smart-home-a-bedtime-button-and-it-actually-makes-every-night-a-little-bit-easier-1t68byctr
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: I gave my smart home a bedtime button, and it actually makes every night a little bit easier | daily.dev
og:description: A personal walkthrough describes building a single 'bedtime' automation that turns off lights, TVs, plugs, adjusts the thermostat, arms security, and enables...
og:url: https://daily.dev/posts/i-gave-my-smart-home-a-bedtime-button-and-it-actually-makes-every-night-a-little-bit-easier-1t68byctr
og:image: https://api.daily.dev/og/posts/1t68BycTr.png
og:image:alt: I gave my smart home a bedtime button, and it actually makes every night a little bit easier
og:image:width: 1200
og:image:height: 630
og:locale: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# I gave my smart home a bedtime button, and it actually makes every night a little bit easier

**[XDA Developers](https://daily.dev/sources/xda-developers)** · 3 min read · 0 upvotes · 0 comments

## Summary

A personal walkthrough describes building a single 'bedtime' automation that turns off lights, TVs, plugs, adjusts the thermostat, arms security, and enables phone Sleep Focus in one trigger, using Home Assistant paired with Node-RED. The author explains why the flow uses absolute state commands rather than toggles (to avoid double-trigger bugs), why the trigger should stay manual rather than time-scheduled, and how the phone-side Sleep Focus setting needs a separate mechanism since it isn't a native Home Assistant entity. Tools like AI Automation Suggester or Claude Code/Codex are mentioned as ways to help design more complex automations.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://www.xda-developers.com/gave-smart-home-bedtime-button-makes-every-night-little-bit-easier>

## Questions this post answers

### Should I use toggle actions or explicit state commands in a Home Assistant automation flow?

Use explicit state commands rather than toggle actions in automation flows. Toggle actions flip a device from its current state, which causes problems if a voice assistant submits the same command twice, potentially turning something back on that should stay off. Telling each node exactly what state to set (like off, not toggle) makes the routine safe to run repeatedly without unintended side effects.

_Developers building reliable smart home flows can find similar automation lessons and discussions on daily.dev._

### How do I control an iPhone Sleep Focus mode from a Home Assistant automation?

Sleep Focus is a phone-side setting rather than a Home Assistant entity, so it can't be controlled directly like a light or plug. Depending on the phone, options include the Home Assistant companion app, a phone-side automation, or a shortcut that Home Assistant triggers as part of the broader flow. It's recommended to keep this piece separate until it works reliably on its own before merging it into the main routine.

_Anyone wiring phone settings into home automations can track these integration patterns via daily.dev._

## Similar posts on daily.dev

- [I built a Home Assistant automation that saves power daily, and nobody in my family even knows it exists](https://daily.dev/posts/i-built-a-home-assistant-automation-that-saves-power-daily-and-nobody-in-my-family-even-knows-it-ex-2s1glqulr) · XDA Developers · 0 upvotes · 0 comments
- [Stop automating your smart home, it's making things worse](https://daily.dev/posts/stop-automating-your-smart-home-it-s-making-things-worse-oxqxro9xg) · XDA Developers · 0 upvotes · 0 comments
- [I Let AI Build a Tool to Help Me Figure Out What Was Waking Me Up at Night](https://daily.dev/posts/i-let-ai-build-a-tool-to-help-me-figure-out-what-was-waking-me-up-at-night-0fzkxhx0t) · Hacker News · 0 upvotes · 0 comments
- [Home Assistant doesn't just control smart devices, and that's where it gets interesting](https://daily.dev/posts/home-assistant-doesn-t-just-control-smart-devices-and-that-s-where-it-gets-interesting-qgtrcyhag) · XDA Developers · 0 upvotes · 0 comments

---

Tags: [#tech-news](https://daily.dev/tags/tech-news), [#automation](https://daily.dev/tags/automation)

[View this post on daily.dev](https://daily.dev/posts/i-gave-my-smart-home-a-bedtime-button-and-it-actually-makes-every-night-a-little-bit-easier-1t68byctr)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"TechArticle","headline":"I gave my smart home a bedtime button, and it actually makes every night a little bit easier","url":"https://daily.dev/posts/i-gave-my-smart-home-a-bedtime-button-and-it-actually-makes-every-night-a-little-bit-easier-1t68byctr","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/i-gave-my-smart-home-a-bedtime-button-and-it-actually-makes-every-night-a-little-bit-easier-1t68byctr"},"datePublished":"2026-09-20T21:01:32.768Z","dateModified":"2026-09-20T21:04:14.640Z","description":"A personal walkthrough describes building a single 'bedtime' automation that turns off lights, TVs, plugs, adjusts the thermostat, arms security, and enables...","image":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/95eb4bd70bc015f35dc8ea8c8996bddf?_a=AQAEuop","thumbnailUrl":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/95eb4bd70bc015f35dc8ea8c8996bddf?_a=AQAEuop","isAccessibleForFree":true,"articleSection":"XDA Developers","inLanguage":"en","publisher":{"@type":"Organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180}},"author":{"@type":"Organization","name":"XDA Developers","logo":"https://media.daily.dev/image/upload/s--kCg6yyAP--/f_auto,q_auto/v1774964407/logos/xda-developers?_a=BAMAMiWQ0","url":"https://daily.dev/sources/xda-developers"},"commentCount":0,"discussionUrl":"https://daily.dev/posts/i-gave-my-smart-home-a-bedtime-button-and-it-actually-makes-every-night-a-little-bit-easier-1t68byctr","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":0},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":0}],"keywords":"tech-news,automation","timeRequired":"PT3M"}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"XDA Developers","item":"https://daily.dev/sources/xda-developers"},{"@type":"ListItem","position":3,"name":"I gave my smart home a bedtime button, and it actually makes every night a little bit easier"}]}
{"@context":"https://schema.org","@type":"FAQPage","@id":"https://daily.dev/posts/i-gave-my-smart-home-a-bedtime-button-and-it-actually-makes-every-night-a-little-bit-easier-1t68byctr#faq","mainEntity":[{"@type":"Question","name":"Should I use toggle actions or explicit state commands in a Home Assistant automation flow?","acceptedAnswer":{"@type":"Answer","text":"Use explicit state commands rather than toggle actions in automation flows. Toggle actions flip a device from its current state, which causes problems if a voice assistant submits the same command twice, potentially turning something back on that should stay off. Telling each node exactly what state to set (like off, not toggle) makes the routine safe to run repeatedly without unintended side effects. Developers building reliable smart home flows can find similar automation lessons and discussions on daily.dev."}},{"@type":"Question","name":"How do I control an iPhone Sleep Focus mode from a Home Assistant automation?","acceptedAnswer":{"@type":"Answer","text":"Sleep Focus is a phone-side setting rather than a Home Assistant entity, so it can't be controlled directly like a light or plug. Depending on the phone, options include the Home Assistant companion app, a phone-side automation, or a shortcut that Home Assistant triggers as part of the broader flow. It's recommended to keep this piece separate until it works reliably on its own before merging it into the main routine. Anyone wiring phone settings into home automations can track these integration patterns via daily.dev."}}]}
```

