Hello, so i bought a shelly 1 gen 4 relay, it's connected to a non smart physical switch, which is connected to smart bulb connected through wifi in home assistant. Now i've added the switch in home assistant through zha, but now the problem is that if i use the switch button in home assistant, i have to press the physical button twice to change the state... how can i avoid this?
#Shelly 1 gen 4
1 messages Β· Page 1 of 1 (latest)
or do i need to switch from zha to mqtt to be able to do this?
or wifi mode? (that's what chatgpt says lol)
So I run my shelly stuff over Wi-Fi and the webui makes it easy to change the switch modes.
I assume you will want to have it in "Detached" mode meaning that it doesnt directly do anything but does report status in HA which you can then use to switch the bulb on/off whilst it remains powered.
How you change the switch mode whilst in zigbee mode is the question here.
In wifi mode you have this on webui:
This is a different model but the principle remains the same.
I then use the switch state changing to trigger a toggle of the light entity from the bulb in HA.
alright thanks!
No worries, It looks like not everything is supported in zigbee mode, however more functionality is expected in future firmware versions.
ok i see
I tend to like Wi-Fi mode anyway as you can then also use it as a bluetooth proxy.
That works well for a dumb bulb but if you have a smart bulb that you want to remain powered even when the light is "off" then detached would be the way to go.
you need to trigger from a change in the input sensor and not the switch entity to see the change.
you may have to enable it
you can see "input 0" here:
the sensor should change between "on" and "off"
but the switch control doesn't do anything because its detached.
you want the switch control to ALWAYS be on.
then you use the sensor changing state to trigger controlling the smart bulb.
ooooh ok i see
the control is for the relay, the sensor is detecting the switch.
It is one of those things that makes a moment but suddenly it clicks.
I suggest have 2 triggers on your automation
sensor going from on->off and off->on
as this will filter out any random state changes going to unavailable and stuff if network drops for a moment or something.
so something like:
trigger: input 0 off->on
trigger: input 0 on->off
action: light toggle smartbulb
lol wait cuz now becuase of me doing shit my bulb is not connected anymore haha
lol, You reset it a few times and it went into pairing mode?
yeah
π
i'm using yeelight bulbs
and now it can't fucking find the bulb anymore
We have all done that before.
ofcourse π
alright
it's working!!!!!
awesome! thanks π
now i need to buy more of these relays for other switches π
Yup, It is a bit of a rabbit hole.
FYI: During sales like "prime day" and such they sometimes have multi packs for a good price. So I tend to "stock up" when that happens so I have some ready to go.
ooh ok i'll be looking out on that then
oh god
i can't fit it in the wall hole hahaha
i think i'll have to buy a mini version of it
I mostly use mini's for this reason.
Note that they have slightly different feature sets but for most cases it doesnt really make a difference.
the relay fits, but with the wall switch and the wago's it doesnt π
ok, all i really need to do is this anyways
Do you have a 3d printer?
no i don't
You get get (or print) spacers.
Even with minis sometimes I have a slightly issue fitting stuff in so have spacers to give a little bit more room.
They are cheap enough, It is just if you had a 3d printer you could solve the issue without ordering something. π
sorry i don't see what youy mean, can you send a picture
moment
UK switch, so might be different for you but the concept remains.
oooh yeah ok so that the wall switch is aactually a little further ok
this fused spur needed 2
I keep meaning to replace it with 1 bigger one but I havent gotten around to it.
π