Switch Manager - New refined switch integration to manage your switches

If you’re like me and have OCD it might feel like your automations is just getting too cluttered or your Node-Red is just getting too squiggly. Firstly, an introduction, I started using Home Assistant to manage my switch buttons but I could not stand them being in automations and theretically a button push isn’t even an automation. It was also cluttering the automations and making my list unnecessary longer. It was also counter productive to have a single automation for each button or having an automation do various checks and processing.

Next i went to Node-Red, this has been fine for the most part and been running my switches for a couple of years, but I’m finding Node-Red to be degrading over time and developers no longer updating or fixing issue eg. Hue Magic and in the end I started to route my switch actions to Home Assistant to handle the buttons. So in the end I would have ZWave JS or MQTT goto node-red then to Home Assistant but I felt having Node-Red being redundant and an unnecessary middle man (the less routes, the less problems). I also have started to find Home Assistant to be more intuitive when it comes to building actions and sequences now (this was not the case a year ago).

So I wanted to solve these problems and that’s why I developed Switch Manager as an integration. I wanted the UI to act like it’s an app that was made by the device manufacturer themselves. I pretty much wanted tap tap, click click and done with a visual representation that’s easy to follow and understand.

The UI is designed to have the switch device show as an image which is clickable and reflective of what that button and their actions should do. If a switch blueprint isn’t already available then I wanted it to be easy for users to create their own. Once a blueprint for a switch is done then it’s set and forget.

All switches you define will not clutter anything in Home Assistant and is fully transparent, this means no extra sensors, entities, scripts or automations etc.

Now that I’ve got that out the way, heres an overview:

Switch manager is a centralised component to handle button pushes for your wireless switches. This includes anything passed through the event bus or MQTT. The component relies on switch blueprints which is easily made to allow GUI configuration of your switches and their button pushes. This helps remove clutter from the automations view as they will be handled independently by this component.

At the moment the frontend borrows heavily from the Home Assistants frontend core modules etc which may break things in future Home Assistant updates but the backend processing should be stable and your switches should work as expected after being configured by the GUI.

Further more, I am happy to accept any pull requests for anyone who wishes to submit missing blueprint for switches from this repository as to help eliminate other users from having to build their own.

23 Likes

I must admit I’m baffled why this hasn’t gotten more attention. It SEEMS exactly like what many people want, myself included. I guess the lack of existing blueprints is stopping people from trying it.

Hopefully I can contribute something soon.

3 Likes

I see where you’re coming from and agree that i figured many people would want something like this but maybe it’s just my OCD thinking other people are like me/us lol. But really it was something I just wanted to tackle for my own experience and needs which in return was coded to be publicly usable. So even if it’s not popular, that’s fine because I didn’t waste time on it as it benifits me eitherway…

It’s still fresh and new and since being on HACs it’s been gaining traction so will see where it goes but I appreciate your positive comment :slightly_smiling_face:

1 Like

how would I convert this blue print to one of yours? I tried to update the deConz to ZHA as it already had the aqara switches

this is the blueprint

1 Like

nevermind worked it out had to change event to command

name: Aqara Opple 3x2
service: ZHA
event_type: zha_event
identifier_key: device_id
buttons:
  - x: 93
    y: 85
    width: 157
    height: 104
    actions:
      - title: Single press
        conditions:
          - key: command
            value: 1_single
      - title: Double press
        conditions:
          - key: command
            value: 1_double
      - title: Triple press
        conditions:
          - key: command
            value: 1_triple
      - title: Long press
        conditions:
          - key: command
            value: 1_hold
      - title: Long release
        conditions:
          - key: command
            value: 1_release
  - x: 250
    y: 85
    width: 157
    height: 104
    actions:
      - title: Single press
        conditions:
          - key: command
            value: 2_single
      - title: Double press
        conditions:
          - key: command
            value: 2_double
      - title: Triple press
        conditions:
          - key: command
            value: 2_triple
      - title: Long press
        conditions:
          - key: command
            value: 2_hold
      - title: Long release
        conditions:
          - key: command
            value: 2_release
  - x: 93
    y: 196
    width: 157
    height: 104
    actions:
      - title: Single press
        conditions:
          - key: command
            value: 3_single
      - title: Double press
        conditions:
          - key: command
            value: 3_double
      - title: Triple press
        conditions:
          - key: command
            value: 3_triple
      - title: Long press
        conditions:
          - key: command
            value: 3_hold
      - title: Long release
        conditions:
          - key: command
            value: 3_release
  - x: 250
    y: 196
    width: 157
    height: 104
    actions:
      - title: Single press
        conditions:
          - key: command
            value: 4_single
      - title: Double press
        conditions:
          - key: command
            value: 4_double
      - title: Triple press
        conditions:
          - key: command
            value: 4_triple
      - title: Long press
        conditions:
          - key: command
            value: 4_hold
      - title: Long release
        conditions:
          - key: command
            value: 4_release
  - x: 93
    y: 308
    width: 157
    height: 104
    actions:
      - title: Single press
        conditions:
          - key: command
            value: 5_single
      - title: Double press
        conditions:
          - key: command
            value: 5_double
      - title: Triple press
        conditions:
          - key: command
            value: 5_triple
      - title: Long press
        conditions:
          - key: command
            value: 5_hold
      - title: Long release
        conditions:
          - key: command
            value: 5_release
  - x: 250
    y: 308
    width: 157
    height: 104
    actions:
      - title: Single press
        conditions:
          - key: command
            value: 6_single
      - title: Double press
        conditions:
          - key: command
            value: 6_double
      - title: Triple press
        conditions:
          - key: command
            value: 6_triple
      - title: Long press
        conditions:
          - key: command
            value: 6_hold
      - title: Long release
        conditions:
          - key: command
            value: 6_release

can you add a duplicate? converting my automation to this, really painful when doing so many

Currently duplicating made switches hasnt been implemented but is on road map

1 Like

So glad I found this one! And agree this deserves more attention…

I have an ikea round remote - I scroll trough a list of lights with left button and then switch them on/off based on a template value in input select list I was scrolling through (as the left button triggers input_select.next and scrolls through list of light entities).

Left button scrolls through a list of lights, right through a list of covers. Up/down is on/off or open/close depending if I was scrolling left or right.

And it just worked! Finally I can tidy up a long list of automations.

Thank you so much!
jhh

Im not understanding the setup step of moving folders around can anyone give me a better breakdown of the steps to do here? Much appreciated.

Have you setup a custom integration before or used hacs? the method is the same

Wow this is amazing! Thank you for making it

1 Like

This is what I’ve been waiting for, after I saw this I bought a Philipps hue dimmer switch, because of how much easier and less cluttered this is. Also I would really like to add my Lifx switch but it has stateless buttons through HomeKit, any ideas?

How does HomeKit integrate with Home Assistant? How do switches generally be handled by HomeKit to Home Assistant?

Here is the Yaml for the trigger when a button is pressed on my HomeKit switch.
I hope this answers your question.

platform: device
device_id: a619295c2541b031dd150ad860690765
domain: homekit_controller
type: button1
subtype: single_press
id: “1”

And that comes in as an event? Or is that just what you use in the automation using the device action?

listen the homekit_state_change event in the Event Tool Page and test the button. If it shows then just follow the blueprint documentation for events

When I click A button on my homekit switch it does not send an event, even when I’m listening to all the events none show up. This is expected behavior. Here is the documentation on the switch:

LIFX Switch

The LIFX integration does not support the LIFX Switch. However, the HomeKit Controller integration can be used instead for LIFX Switch running firmware 3.90 or higher. Follow the LIFX documentation to obtain a HomeKit code prior to integrating the Switch with Home Assistant as it will be needed during the process.

When using the HomeKit Controller integration, each button on the LIFX Switch is discovered as a stateless switch and will not appear as an entity in Home Assistant. Relays that are configured as wired to non-LIFX devices will appear as normal switches in Home Assistant.

Basically it is a stateless switch, Hoped that helped

Techincally all the buttons that come in through the event bus and MQTT are stateless because they don’t retain anything nor are there any entities for it. They just notify on an action, so everything in Switch Manager is pretty much stateless. I’m not familiar nor have I experienced Homekit etc so another member of the community might be able to chime in about it and be more helpful.

But the way it’s described through the documentation for Homekit, You use the device action, the device action has to receive that information just like how information is retrieved through events etc. They’re not stored they’re just sent and handled. I’ve used google doorbell which also describes using the device action to handle events yet it’s also available through the event bus for alternative access, this should be the norm for any integration and if HomeKit isn’t doing this then I would be raising an issue with them as to why not.

The other alternative is handle it through an automation then relay it through an event or use node red and send it as an event or mqtt from there. So even if HomeKit doesn’t want to use event’s (which is baffling) then you have other options.

Ok that’s helpful I’ll see if I can make a working blueprint.

Looks like a good way to clean up the dashboards, but you assume that everyone understands Blueprints. Too complex for me to install.

Perhaps if your example wasn’t so complex? Just a few buttons on/off, not attached to any particular device. (None of which I have).