Switch Manager - New refined switch integration to manage your switches

@Sian I am getting these warnings since I installed, everything still working fine though

Logger: custom_components.switch_manager.const
Source: helpers/script.py:1783
Integration: Switch Manager (documentation, issues)
First occurred: 5:36:22 PM (25 occurrences)
Last logged: 8:30:43 PM
switch_manager_34_1_0: Already running
switch_manager_28_1_0: Already running
switch_manager_28_3_0: Already running

Try restarting HA and see how that goes

Hi Sian,

What a great integration did you develop! I am just figuring out HA have it running with Zigbee2MQTT all my devices are connected via a Zigbee dongle.

I have two questions:

  1. I want to make my remote (Hue Dimmer switch v2) cycle through scenes.
    My scenes are in HA but also in Z2M (but they aren’t exposed to HA so not using them currently). My Hue Dimmer is bound to a group of lightbulbs via Z2M.

Do you have a good example on how to do this? (I currently have it implemented with a script cycling through an input selector. But it’s not really clean and most of all not very reliable.
To my understanding this should be easily implemented in Switch Manager. Would be great to have an example!

  1. I also have an Ikea E1744 controller that is not recognised with auto-discovery. I manually entered the MQTT Topic which I got from the MQTT Tool as you mentioned in the documentation but nothing happens when pressing a button. I noticed that the blueprint uses different values than the ones I see when checking the payload with MQTT Tool (legacy is set to false btw). So I changed the blueprint but that also didn’t help. (I didn’t restart I just realised). I got the same values as mentioned in: Correct IKEA E1744 Z2M action keys by qp68 · Pull Request #179 · Sian-Lee-SA/Home-Assistant-Switch-Manager · GitHub

“I think I have a solution for your point 1. I just created a post last week explaining my script that I use to toggle through my Hue scenes. It also selects random scenes and has a smooth transition. You can then easily select the script in the Switch Manager as an action/sequence. Here is the link: https://community.home-assistant.io/t/hue-scenes-random-selection-with-smooth-transition/636319.

1 Like

**EDIT: I reinstalled everything from scratch, and it’s working perfectly now. Leaving this here in case anyone else has issue in future

Hi,

First of all, thanks for your work creating this. I’m new to HA and I think this will help me setup my switches in a neat & easy to manage way.

I have 2 different remote models that I’m testing with, and I can get neither of them working with brightness up on button hold.

I’ll focus on the newer of the two remotes: Ikea E2002, STYRBAR

I have added the remote in Switch Manager. I can configure short press fine.
The issue is with long press.
I have a light that I want to increase brightness when I hold the top button. I use the visual editor to pick the “Light: Turn on” service for the light. The YAML is:

service: light.turn_on
data:
brightness_step: 20
target:
device_id: 95167ff6194e1268240076deb6fa4099

When I hold the button, the “HOLD” tab flashes. The light increases by 20 steps, once. It doesn’t continue to increase.

In the logbook I see: (In descending order timewise)

IkeaSquareRemoteSpare Action
15:38:04 - 4 seconds ago
IkeaSquareRemoteSpare Action changed to brightness_stop
15:38:04 - 4 seconds ago
IkeaSquareRemoteSpare Action
15:37:57 - 11 seconds ago
IkeaSquareRemoteSpare Action changed to brightness_move_up
15:37:57 - 11 seconds ago

So, I can see the hold of the button is registered for the 7 seconds I held it for, but the brightness of the light is only increasing by 20 steps, and not repeating.

I’ve included the Z2M logs below too in case they can help.
Any ideas please?

I’m wondering if there’s something amiss with my configuration because it seems to “just work” for other users.

Thanks so much for your time.
Cork

The Zigbee2MQTT logs show:

2023-11-14 15:41:27MQTT publish: topic 'zigbee2mqtt/IkeaSquareRemoteSpare', payload '{"action":"brightness_move_up","action_rate":83,"battery":5,"linkquality":212,"update":{"installed_version":65572,"latest_version":581,"state":"idle"},"update_available":null}'

Info 2023-11-14 15:41:27MQTT publish: topic 'zigbee2mqtt/IkeaSquareRemoteSpare', payload '{"action":"","battery":5,"linkquality":212,"update":{"installed_version":65572,"latest_version":581,"state":"idle"},"update_available":null}'

Info 2023-11-14 15:41:27MQTT publish: topic 'zigbee2mqtt/IkeaSquareRemoteSpare', payload '{"action":"","battery":5,"linkquality":212,"update":{"installed_version":65572,"latest_version":581,"state":"idle"},"update_available":null}'

Info 2023-11-14 15:41:27MQTT publish: topic 'zigbee2mqtt/IkeaSquareRemoteSpare', payload '{"action":"","battery":5,"linkquality":212,"update":{"installed_version":65572,"latest_version":581,"state":"idle"},"update_available":null}'

Info 2023-11-14 15:41:27MQTT publish: topic 'zigbee2mqtt/IkeaSquareRemoteSpare', payload '{"action":"","battery":5,"linkquality":212,"update":{"installed_version":65572,"latest_version":581,"state":"idle"},"update_available":null}'

Info 2023-11-14 15:41:27MQTT publish: topic 'zigbee2mqtt/IkeaSquareRemoteSpare/action', payload 'brightness_move_up'

Info 2023-11-14 15:41:27MQTT publish: topic 'zigbee2mqtt/IkeaSquareRemoteSpare/action', payload 'brightness_move_up'

Info 2023-11-14 15:41:27MQTT publish: topic 'zigbee2mqtt/IkeaSquareRemoteSpare/action', payload 'brightness_move_up'

Info 2023-11-14 15:41:27MQTT publish: topic 'zigbee2mqtt/IkeaSquareRemoteSpare/action', payload 'brightness_move_up'

Info 2023-11-14 15:41:27MQTT publish: topic 'zigbee2mqtt/Bulb - tall light sitting room', payload '{"brightness":254,"color_mode":"color_temp","color_temp":383,"color_temp_startup":454,"linkquality":100,"power_on_behavior":"on","state":"ON","update":{"installed_version":604050705,"latest_version":604050705,"state":"idle"},"update_available":null}'

Info 2023-11-14 15:41:34MQTT publish: topic 'zigbee2mqtt/IkeaSquareRemoteSpare', payload '{"action":"brightness_stop","battery":5,"linkquality":204,"update":{"installed_version":65572,"latest_version":581,"state":"idle"},"update_available":null}'

Info 2023-11-14 15:41:34MQTT publish: topic 'zigbee2mqtt/IkeaSquareRemoteSpare', payload '{"action":"","battery":5,"linkquality":204,"update":{"installed_version":65572,"latest_version":581,"state":"idle"},"update_available":null}'

Info 2023-11-14 15:41:34MQTT publish: topic 'zigbee2mqtt/IkeaSquareRemoteSpare', payload '{"action":"","battery":5,"linkquality":204,"update":{"installed_version":65572,"latest_version":581,"state":"idle"},"update_available":null}'

Info 2023-11-14 15:41:34MQTT publish: topic 'zigbee2mqtt/IkeaSquareRemoteSpare', payload '{"action":"","battery":5,"linkquality":204,"update":{"installed_version":65572,"latest_version":581,"state":"idle"},"update_available":null}'

Info 2023-11-14 15:41:34MQTT publish: topic 'zigbee2mqtt/IkeaSquareRemoteSpare', payload '{"action":"","battery":5,"linkquality":204,"update":{"installed_version":65572,"latest_version":581,"state":"idle"},"update_available":null}'

Info 2023-11-14 15:41:34MQTT publish: topic 'zigbee2mqtt/IkeaSquareRemoteSpare/action', payload 'brightness_stop'

Info 2023-11-14 15:41:34MQTT publish: topic 'zigbee2mqtt/IkeaSquareRemoteSpare/action', payload 'brightness_stop'

Info 2023-11-14 15:41:34MQTT publish: topic 'zigbee2mqtt/IkeaSquareRemoteSpare/action', payload 'brightness_stop'

Info 2023-11-14 15:41:34MQTT publish: topic 'zigbee2mqtt/IkeaSquareRemoteSpare/action', payload 'brightness_stop'

I’m just posting simply to emphasise my views about device id’s instead of using just entity id’s and follow on with @YellowMonster76 (not trying to start a debate or flame war etc.).

I think the latest Home Assistant update and the following issue Automations referencing non-existing devices do not work after installing 2023.11.0b1 · Issue #102937 · home-assistant/core · GitHub emphasises how messy device id’s can be. If people don’t wan’t headaches in the future while also being in control of their “system” then I really encourage everyone to try and use enitity id’s and service calls when possible. But again it’s a personal choice but my personal efforts in tackling device actions in future will be less prioritised.

Another good read I found just now Why and how to avoid device_ids in automations and scripts - #4 by sebby

Credit to the developer for making this fantastic integration, hopefully we’ll see something similar implemented in HA natively. :clap:

2 Likes

Has anyone made a blueprint for the Ikea Shortcut button under ZHA? Its possibly a bit beyond my ability to be truthful!

Hey, I’ve the same issue here… I’ve been using the Awesome HA Blueprints up until now to utilize my IKEA E1743 remotes for controlling my lights, but that blueprint seems to be abandoned.

I tried using Switch Manager, but ran into the same issue as you - upon holding the up/down button the brightness goes down/up by one step, but then stops.

By reinstalling everything from scratch, what do you mean exactly?

Hey,

Initially I had HA installed on a PC. I did a total rebuild on a Raspi 4 and was able to get the hold working for a while. However, it’s since stopped and I’ve abandoned trying altogether. I just use stepped increase in brightness now on multiple presses.
I even tried binding the switches directly to light groups in Z2m and that worked sometimes, but other times it wouldn’t.
I think it’s the Ikea switches that are the issue rather than Switch Manager.

Cd

1 Like

Thanks! On a pi4 here as well, but damned if I’d do a full rebuild here :smiley: Too much stuff to be rebuilt… I’ll continue to use Awesome HA Blueprint then, since a fork of that still works with hold for the moment. Shame that Switch Manager doesn’t, as it seems to be actively developed…

1 Like

hi, i’m using this to manage the hue dimmer switches i have.

i have 4 x 324131092621 (the ones with a separate on and off button), and 1 x 929002398602 (the one that has a single on/off button).

the 324131092621 are all working fine, however the 929002398602 i’m not sure how to configure, if press the power button on the switch it turns the lights on, but then how to a configure it to power them off using the same button?

this is how the power button is currently configured

You can either check the state of the entities and do something different based on that or use the light.toggle service instead of light.turn_on/.turn_off.

1 Like

good call, sometimes the obvious evades you

I have bunch of Ecosmart 4 button switches added to Z2M, Is there a way we can get them added to the Switch manager blueprints?
This is the device page on Z2M : Leedarson 6ARCZABZH control via MQTT | Zigbee2MQTT

is it possible to adjust the dim level increments?
at the moment it is quite a stark brightness change with each press of the dim up/down button.

i’d like to make a bit a more smooth if possible.

Hi,

Complements for the creation off this integration!
I am trying to add a non supported switch. Livarno / Lidl FB21-001
(Lidl FB21-001 control via MQTT | Zigbee2MQTT)

It almost works only the Off doesn’t. In debug mode you see the off being triggered but no action is triggered. Any idea how to move forward?

name: Lidl (FB21-001)
service: Zigbee2MQTT
event_type: mqtt
mqtt_topic_format: zigbee2mqtt/+/action
buttons:
  - x: 2
    y: 2
    width: 189
    height: 159
    actions:
      - title: init
        conditions:
          - key: payload
            value: on
      - title: press
        conditions:
          - key: payload
            value: switch_scene
  - x: 2
    y: 161
    width: 189
    height: 90
    actions:
      - title: press
        conditions:
          - key: payload
            value: brightness_step_up
      - title: hold
        conditions:
          - key: payload
            value: brightness_move_up
      - title: hold (released)
        conditions:
          - key: payload
            value: brightness_stop
  - x: 2
    y: 251
    width: 189
    height: 90
    actions:
      - title: press
        conditions:
          - key: payload
            value: brightness_step_down
      - title: hold
        conditions:
          - key: payload
            value: brightness_move_down
      - title: hold (released)
        conditions:
          - key: payload
            value: brightness_stop
  - x: 2
    y: 341
    width: 189
    height: 159
    actions:
      - title: press
        conditions:
          - key: payload
            value: off

anyone???

In light.turn_on there is a “Brightness Step” setting. This should allow you do decide from 0 to 100% how much to change the level on each step.

I’m talking about when the light is already on.
With the light on, pressing the dim up or down button the coming steps are quite jarring