Shelly (1/1PM) with Philips Hue Lights

In the past (HomeKit only!) we outfitted a lot of our house with Philips Hue and they have been rock solid. I have now moved to HA for the entire smart home backend and only use HomeKit for the front end.

There is one scenario I would like to try and solve. We are both now very sorted with the automated lighting that has been setup, so much so that we dont need to switch anything on and off any more. However if parents come round etc they feel the need to switch a switch off. This would also cover the “im away and something has gone wrong” issue :slight_smile:

I would like to have the following:

1). The light powered all the time
2). When HA is running, the switch down/up triggers the on/off automation.
3). When HA is not running (for some reason?) it reverts to acting like a normal switch and directly turns the power to the light on and off.

Does anyone know if this can be done with the standard integration?

PS: I did read somewhere that ESPHome on the device can do something like this (I dont currently use ESPHome).

PSS: Please don’t suggest to change the switches. This is “absolutely not happening” :smiley:

You can change the button type through the http API: API Reference

But if HA is down, this won’t help :wink:

Hey,

assuming I understood correctly:

  • You have connected a Shelly 1/1PM behind your swtich.
  • Connected to the O port of your Shelly is a phillips hue light
  • Connected to the Switch port of your Shelly is the switch
  • Both (Phillips Hue & Shelly) are integrated with Home Assistant

Your case 2) requires the Shelly switch to be configured as “detached switch” (so it only “reports” to home assistant the switch was pressed but does not do anything at its own.
Your case 3) requires the Shelly switch to be configured as “flip” (see Switch | Shelly Technical Documentation).

The issue here is that the Shelly itself does not have any backend which could check for HA is running or HA is not running. Based on this the Shelly cannot decide if it’s switch should act as “detached” or “flip”.

The only solution I see is that you trigger an automation on events “homeassistant_started” & “homeassistant_stop” which then uses a shell command (e.g. via CURL ) to reconfigure the switch using Shelly API into the two different modes. (As the default shelly integration does not allow to reconfigure the shelly device switch mode as of my knowledge)

Downsides are:
If your HA is down unexpected (due to power outage, wifi outage etc.), the switch still stays within “detached” mode.
The solution is very complex to accomplish with different integrations and actions etc. …

I have some 1pms configured with esphome just like that.

This post should get you started:

It works pretty solidly with localtuya.

oh thanks! I will check this out :slight_smile:

Is there anyone that has any ideas on how to do this with the new Plus second gen models. They can run some script and talk to other devices, so I’m curious as to whether this now might be possible.