Switch Manager - New refined switch integration to manage your switches

The bottom example has 1 button and 3 actions? Further more there are over 50 examples of the already created ones.

The device part in the examples are simply placeholders, could you imagine the issues poping up because people weren’t getting a full example and missing some vital properties? Just reading the exmples clearly indicates what, when and how while also being referenced in the same documentation.

No where do I assume people understand blueprints (that’s even more evident in the fact I accept blueprints from the community to have them readily available for users who don’t wish to create it themselves), but the documentation pretty much covers everything you need to create one. If it’s overwhelming then that’s fine, I would also assume you’re not familiar with standard editing yaml in Home Assistant in general and would use premade blueprint’s for general automations. I think the reverse is more prominent where casual users expect’ss things to be click and go for things that hasn’t been created. The Blueprint’s are there for users who don’t mind editing yaml or spend a little time reading the documentation but that goes with anything, you need to understand and read then do some executions on it to understand and learn. If you wan’t to be hand fed the blueprints, then you’ll just have to wait for someone to make it. No much more can be done about that.

1 Like

You assume an awful lot. Mostly wrong. Practically every section of your documentation refers to Blueprints. But I will install it anyway, but my expectations are lowered.

“Furthermore” is one word.

expect’ss is also expects, not sure if your grammar corrections is compensating for some kind of insecurity?

I can tell you what I do assume though, if you wan’t to make a blueprint, then the information is all there. There’s nothing right or wrong about it. Furthermore :wink: hope that satisfies but i’m sure you’ll hunt for some thing else to police (this is bait. hint I’m not an American. Also there’s an easter egg to fulfil your need to further correct within this sentence), blueprint’s are needed for anything to work in the integration so how could I not document more about the engine that runs it? Do you prefer buying something from Ikea without instructions on how to put it together? I really don’t understand your logic.

1 Like

Since none of my switches are on your Blueprint list, I will not be trying the integration, and I have no desire to write a blueprint for a generic WiFi switch.

BTW, the Documentation button goes nowhere.

Thanks for pointing out something to be “fixed” during BETA development. I also don’t really understand how you tried something to end up not trying it :woman_shrugging:. Either way your input is appreciated. Thank you

1 Like

Does anybody know if there is a blueprint for the Phillips Hue Smart Button for Zigbee2MQTT? I used the Silvercrest smart button one which kinda works, but for each on and off action I have to press the button twice? Also is there a way to cycle the brightness if the button is hold?

You’ll want to copy a blueprint similar then reference the actions decribed here. As you stated, the Silvercrest would be the best option to copy and modify to match the actions described in the link.

Also, the references to how the device operates is solely dependent on how the device was manufactured or how the integration (in this case Zigbee2MQTT) handles an action. So if the device has an action where you push one time but that action is internally known as ‘on’ then Switch Manager would interporate that as a single press (just based on a title). If a brightness was say 3 presses then Switch Manager would use the title press 3x as it’s irrelevant to switch manager if that action was internally intended for changing a brightness… Instead you can choose and decide what that acton should do in your sequences which might have nothing to do with brightness etc.

Actually, after having a look there already is a Z2M blueprint for the Smart Button. Have you tried that blueprint?

Edit: Ohh, just realised it was added in the latest release. Try the latest release and see if that works.

Perfect, thanks, I just see just see the new release…

@Sian in your intro video you mentioned shortly a smooth brightness adjust script. I am still trying to figure out how could i make the philips smart button to adjust brightness when holding and cycling it. Could you share a video or a tutorial how to implement something like that?

I don’t own the smart switch so I can’t give too much advice but I don’t think the brightness up and down would need a smooth script as the time it takes to goto the next brightness step then the repeat for a “hold” (or however that switch functions with the brightness action) delay would already have the brightness set ready for the next step…

A generic sequence for the action you want for brightness should suffice…

service: light.turn_on
target:
  entity_id: light.living_room_main
data:
  brightness: "{{ state_attr('light.living_room_main', 'brightness') + 10 }}"

change the + to a - for brightness down

Just chiming in to say thanks for your hard work on making this visually appealing and easier to visually create automations. I think this is the foundation of how the some of the rest of the eco-system in HA should go.

2 Likes

Sian, I also just want to say thank you for creating this! I love that this simplifies and organizes all of my hue switch automations/actions. This is so much cleaner than having 4 separate automations cluttering up my automation page!

1 Like

I’m trying to set up a hold action for the Ikea Strybar in ZHA, however for some reason it seems to always get stuck in an endless loop. It could be due to the fact that, as far as I’ve found, the hold_release event for the top and bottom button is the same. The blueprint currently is the following:

name: Ikea Styrbar ZHA
service: ZHA
event_type: zha_event
identifier_key: device_id
buttons:
  ## Not sure why the buttons are back to front and illogical by their numbers??
  - x: 247
    y: 61
    width: 50
    actions:
      - title: press
        conditions:
          - key: command
            value: 'on'
      - title: hold
        conditions:
          - key: command
            value: move_with_on_off
      - title: hold_release
        conditions:
          - key: command
            value: stop_with_on_off

  - x: 442
    y: 248
    width: 50
    actions:
      - title: press
        conditions:
          - key: command
            value: press
          - key: params.param1
            value: '256'
      - title: hold
        conditions:
          - key: command
            value: hold
          - key: params.param1
            value: '3328'
      - title: hold (released)
        conditions:
          - key: command
            value: release
          - key: params.param1
            value: '-7258'
  - x: 245
    y: 434
    width: 50
    actions:
      - title: press
        conditions:
          - key: command
            value: 'off'
      - title: hold
        conditions:
          - key: command
            value: move
      - title: hold_release
        conditions:
          - key: command
            value: stop_with_on_off
  - x: 52
    y: 248
    width: 50
    actions:
      - title: press
        conditions:
          - key: command
            value: press
          - key: params.param1
            value: '257'
      - title: hold
        conditions:
          - key: command
            value: hold
          - key: params.param1
            value: '3329'
      - title: hold (released)
        conditions:
          - key: command
            value: release
          - key: params.param1
            value: '1675'

And the automation it fires:

- wait_template: "{{ data.button_last_state[2].action == 1 }}"
  continue_on_timeout: false
  timeout: "00:00:20"
- service: notify.persistent_notification
  data:
    message: hold pressed
    title: "{{ data.button_last_state[2].action }}"
- repeat:
    until:
      - condition: template
        value_template: "{{ data.button_last_state[2].action != 1 }}"
    sequence:
      - service: light.turn_on
        data:
          brightness_step_pct: -5
        target:
          entity_id: light.bed_lights
      - delay:
          hours: 0
          minutes: 0
          seconds: 0
          milliseconds: 50
- service: notify.persistent_notification
  data:
    message: hold pressed stop
    title: "{{ data.button_last_state[2].action }}"

I left the notifications in there as a check, however the last notify action is never fired. Attaching one to the hold_release action does fire two events (since both the up and down button are seen as not being held anymore. Do you happen to have an idea as to what’s causing this? There are also multiple events fired for each button press, perhaps that could also be causing issues, though I am not sure how to set the debounce in ZHA.

Also, massive thanks for this integration! The interface is incredible and it’s been a joy to work with. A lot clearer than building from automations :smiley:

Hi, can I set the actions for double or triple press on the hue remote dimmer via z2m? I can only see init, press, hold and hold release

Z2M doesn’t support double or triple press for the Hue Dimmers

2 Likes

Another satisfied user here. I’ve been transferring all my devices to ZHA and at the same time adding them to Switch Manager, saving me up to 4 automations wasting space in my list.
This should really be added to HA, although I’ve seen how much work/time it takes to get an integration added in there. In the meantime I’ll keep adding blueprints for my devices.Great work!

+1 for the feature request to copy switches, I’ve got a lot of the same button that does basically the same things every time but in different rooms, so if I could just duplicate it and only change the room/light it acts on would save some time. Or alternatively a “edit as YAML” button for the entire switch so I can copy-paste that into a new switch. That might be easier to make.

1 Like

I’m looking forward to being able to use this Integration one day, but currently all my devices are only available via Zigbee2mqtt and I use ZHA… Any idea when the likes of IKEA 5 button remotes will be available under ZHA? Also, the Xiaomi round buttons?

I don’t have one of those but I’m also busy converting the IKEA buttons that I do have to ZHA format. It’s actually pretty easy. Copy the z2m blueprint to a new one, dave-zha-ikea-tradfri-remote.yaml for example, now take an existing ZHA template to see the format you need for ZHA events, then check the event monitor in Developer options to see what exactly happens when you press each button.
Most likely each button will just give command: on for a specific endpoint and cluster id. That should get you the basic press events. Then for hold and release you do the same depending on the exact payload.

1 Like

I’m looking at a menu option within the editor of a switch where you can copy from an existing switch of the same blueprint. I will also add a toggle option to also copy the variables from the switch. This should then have a copy of the switch then allow to easily change a variable for eg target entity etc.

2 Likes