this post was submitted on 20 Apr 2025
1 points (100.0% liked)

Home Assistant

412 readers
1 users here now

Home Assistant is open source home automation that puts local control and privacy first. Powered by a worldwide community of tinkerers and DIY...

founded 2 years ago
MODERATORS
 
This is an automated archive made by the Lemmit Bot.

The original was posted on /r/homeassistant by /u/Home_Assistantt on 2025-04-20 13:57:17+00:00.


Ive been using HA for a good 4-5 years now and thought I managed to find my way around most things...but something had bugged me for ages...but Ive finally worked it out.

I have a number of dumb switches made smart with relays behind those switches that turn smart lights on/off but with the actual switch itself is detached so the power isn't cut to the smart bulbs and the input boolean being the one to control the lights, mainly via Node-Red but it also works via HA native automations.

So all of these lights work fine but of course I had issues when I wanted to launch said light from a dashboard...as I was controlling these entitiies directly, they never hit the automations as I was controlling the entities themselves rather than the binary sensor that was toggling the switches on/off setting....and this element cannot be affected directly in home assistant.

Then last week it finally clicked, set a toggle helper and have toggle of this element toggle the relevant automation in addition to the binary sensor of the relay. This alone means you now turn the light on or off and it is set by the same rules that apply when the switch itself is used, but then it mean the swtich icon state you use no longer shows correctly if the light is on or off and can get out of sync if you turn it off on the wall but on on the dashboard...but that can be sorted as well using a custom button card.

Here is my yaml for that below

type: custom:button-card

entity: light.studyceilinglight

state:

  • value: "on"

color: white

  • value: "off"

color: null

tap_action:

action: toggle

entity: input_boolean.studylightib

name: Study Light

icon: phu:ceiling-round

show_state: false

show_name: false

aspect_ratio: 1

Again, this isnt a ground-breaking thing by any means but it's ticked a box for me so I hope it might help some others

no comments (yet)
sorted by: hot top controversial new old
there doesn't seem to be anything here