Shelly Detached Input Blueprint – Switch & Button Mode with Fallback Script (v1.3)
Hi HA Community! ![]()
I’ve released a Home Assistant automation blueprint for Shelly Gen3 & Gen4 devices
configured in detached input mode.
It allows you to use physical switches or buttons to control smart lights or automations
without physically switching mains power, while maintaining predictable behavior
even during Home Assistant restarts.
Typical use case
Do you want to use a physical wall switch to control your smart lights
without cutting power to the bulbs?
This blueprint is designed exactly for that.
Example setup
Smart lights (Hue, Zigbee, Wi-Fi, etc.)
Shelly Gen3 device in detached mode
Classic wall switch or
Shelly Wall Switch (2)
In this setup:
- The wall switch does not physically disconnect the lights
- The Shelly input only reports user interaction
- Home Assistant handles the smart logic
- Basic interaction remains functional even if Home Assistant
is temporarily unavailable, thanks to the local Shelly fallback
This results in a much more reliable and partner-friendly smart lighting experience.
Safety note
Shelly devices work with mains voltage.
If you are unsure about wiring, consult a qualified professional installer.
What does the blueprint support?
Input modes
- Switch mode
- Uses a
binary_sensor - Triggered on OFF ↔ ON transitions
- Uses a
- Button mode
- Uses a Shelly
evententity - Supports:
single_pushdouble_pushlong_push
- Uses a Shelly
Action modes
- Lamp mode
- Switch mode → toggle
- Button mode:
- single press → toggle
- double press → 100% brightness
- Custom mode
- Define your own actions per event or state
Optional local fallback (Gen3 & Gen4)
An optional Shelly script provides local confirmation and predictable behavior:
- Runs directly on the Shelly
- Generates a short confirmation pulse on every input
- Continues to work during Home Assistant restarts
- Same script for switch and button mode
The fallback works together with a virtual confirm switch.
Confirm switch configuration
On Shelly Gen3 & Gen4 devices, the confirm switch is a Boolean component.
Steps:
- Open the Shelly web interface
- Go to Settings → Components
- Click Create new → Boolean
- Set:
- Name:
confirm - View:
Toggle
- Name:
- Leave all other options default and save
This component appears in Home Assistant as a switch entity
and can be selected as the Confirm switch in the blueprint.
Required inputs (HA limitation)
Home Assistant requires all trigger entities to be valid.
This means:
- Switch mode → switch input is required
- Button mode → button event entity is required
If an input is not relevant for your selected mode,
simply select any entity — it will be ignored.
Repository
Blueprint, fallback script, and documentation:
GitHub - willumpie82/homeassistant-blueprints: Homeassistant blueprints
Sneak peek: v1.4
Planned features:
Scene controller support
Advanced dimming options
More flexible per-event actions
Further UI improvements
Feedback welcome!
Let me know:
- how you’re using the blueprint
- which Shelly devices you’re running
- what you’d like to see in v1.4
Happy automating! ![]()