Zigbee2MQTT - OSRAM Smart+ switch mini (AC0251100NJ/AC0251700NJ) actions

Github Gist: osram_switch_mini_zigbee2mqtt.yaml · GitHub

Main features

Define actions for each button press type (up, up_hold, up_release, down_release, circle_release, circle_hold, down, down_hold, circle_click).

Supported device


This blueprint supports the OSRAM AC0251100NJ/AC0251700NJ device through Zigbee2MQTT only.

Prerequisites

You need to find the Zigbee2MQTT topic name for your device, for instance zigbee2mqtt/Osram Remote Kitchen and set this as the mqtt_topic input variable.

Blueprint

Click the badge to import this Blueprint: (needs Home Assistant Core 2021.3 or higher)

Open your Home Assistant instance and show the blueprint import dialog with a specific blueprint pre-filled.

Or import this Blueprint by using the forum topic URL:

blueprint:
  name: Zigbee2MQTT - OSRAM Smart+ switch mini (AC0251100NJ/AC0251700NJ) actions
  description: >
    Define actions for your OSRAM Smart+ switch mini  using Zigbee2MQTT.
    This blueprint requires a MQTT topic for your button and the actions you want to take for each button press type.  domain: automation
  domain: automation
  author: freakshock88
  homeassistant:
    min_version: "2024.10.0" # Due to updated trigger syntax
  input:
    mqtt_topic:
      name: OSRAM Smart+ switch mini MQTT topic
      description: MQTT topic for OSRAM Smart+ switch mini. e.g. "zigbee2mqtt/Osram Remote Kitchen"
    remote_button_up:
      name: Up Press
      description: Action to run on up press
      default: []
      selector:
        action:
    remote_button_up_hold:
      name: Up Hold
      description: Action to run on up hold
      default: []
      selector:
        action:
    remote_button_up_release:
      name: Up Release
      description: Action to run on up release
      default: []
      selector:
        action:
    remote_button_circle:
      name: Circle Press
      description: Action to run on circle press
      default: []
      selector:
        action:
    remote_button_circle_hold:
      name: Circle Hold
      description: Action to run on circle hold
      default: []
      selector:
        action:
    remote_button_circle_release:
      name: Circle Release
      description: Action to run on circle release
      default: []
      selector:
        action:
    remote_button_down:
      name: Down Press
      description: Action to run on down press
      default: []
      selector:
        action:
    remote_button_down_hold:
      name: Down Hold
      description: Action to run on down hold
      default: []
      selector:
        action:
    remote_button_down_release:
      name: Down Release
      description: Action to run on down release
      default: []
      selector:
        action:

mode: restart
max_exceeded: silent

# Each option is explicitly defined as a trigger because sensor reports empty values as well.
# Not defining explicit triggers causes the automation to show up in the log multiple times per button press.
triggers:
  - trigger: mqtt
    topic: !input mqtt_topic
    payload: "on"
    value_template: "{{ value_json.action }}"
    id: up
  - trigger: mqtt
    topic: !input mqtt_topic
    payload: brightness_move_up
    value_template: "{{ value_json.action }}"
    id: up_hold
  - trigger: mqtt
    topic: !input mqtt_topic
    payload: brightness_stop
    value_template: "{{ value_json.action }}"
    id: up_release
  - trigger: mqtt
    topic: !input mqtt_topic
    payload: brightness_move_to_level
    value_template: "{{ value_json.action }}"
    id: circle_click
  - trigger: mqtt
    topic: !input mqtt_topic
    payload: move_to_saturation
    value_template: "{{ value_json.action }}"
    id: circle_hold
  - trigger: mqtt
    topic: !input mqtt_topic
    payload: "off"
    value_template: "{{ value_json.action }}"
    id: down
  - trigger: mqtt
    topic: !input mqtt_topic
    payload: brightness_move_down
    value_template: "{{ value_json.action }}"
    id: down_hold
  - trigger: mqtt
    topic: !input mqtt_topic
    payload: brightness_stop
    value_template: "{{ value_json.action }}"
    id: down_release

action:
  - choose:
      - conditions:
          - condition: trigger
            id: "up"
        sequence: !input remote_button_up
      - conditions:
          - condition: trigger
            id: "up_hold"
        sequence: !input remote_button_up_hold
      - conditions:
          - condition: trigger
            id: "up_release"
        sequence: !input remote_button_up_release
      - conditions:
          - condition: trigger
            id: "circle_click"
        sequence: !input remote_button_circle
      - conditions:
          - condition: trigger
            id: "circle_hold"
        sequence: !input remote_button_circle_hold
      - conditions:
          - condition: trigger
            id: "circle_release"
        sequence: !input remote_button_circle_release
      - conditions:
          - condition: trigger
            id: "down"
        sequence: !input remote_button_down
      - conditions:
          - condition: trigger
            id: "down_hold"
        sequence: !input remote_button_down_hold
      - conditions:
          - condition: trigger
            id: "down_release"
        sequence: !input remote_button_down_release

Changelog

  • 2021-03-01: Initial version
  • 2025-01-11: Updated for Z2M v2 which no longer has the button sensor entity, but instead we use an MQTT trigger with a configured topic.

If you have any issues or questions, please let me know :slight_smile:

1 Like

Thank you for this. I made 3 different automations to use the Switch Mini. This will help a lot. :slight_smile:

Unfortunately this works only for zigbee2mqtt, while I’m using ZHA, which doesn’t provide an entity for the device, I only have the device, and one entity (the battery power).

Well yeah, this blueprint is specifically designed for using with Zigbee2MQTT. I don’t use ZHA so I can’t support that in my blueprint :wink:

Yeah, sorry for that, I only noticed after I installed it. :slight_smile:

I might use your blueprint and adapt it to ZHA…I’ll think about it. Thanks anyway for your work.

How would someone go and make such a blueprint? It’s unclear to me how to ‘guess’ the states like “circle_hold”. I assume it’s how Zigbee2MQTT integrated it. But how to know?
How would I go about making a ZHA blueprint for this device?

I’ve searched, but haven’t found a tutorial or something. Can someone point me in the right direction on how to learn how to do it? I would be forever grateful :slight_smile:

hi, did you manage to fix the functionality of this switch with zha

The good @epmatt, solicited by me, kindly developed one of his awesome blueprints for this controller.

Here you can find the discussion: Add support for Osram SMART+ Switch Mini by EPMatt · Pull Request #69 · EPMatt/awesome-ha-blueprints (github.com)

I suggest you (and also @Tinkering) check his doc site: Awesome HA Blueprints | Awesome HA Blueprints (epmatt.github.io)

It’s working very well in my house, I have 4-5 of these controllers. :slight_smile:

1 Like

Thanks, I’ll try.
One question, but is it normal that it is seen as a sensor and not as a switch? and and is it normal that the state is always “unknown”?

Thanks, I solved it, the only thing that is not working for me is the double_center. I don’t know why but it doesn’t work.

We’re totally OT in this thread.

please open an issue here: Issues · EPMatt/awesome-ha-blueprints (github.com)

1 Like

When I look at the docs at zigbee2mqtt.io there is a line that highly recommends legacy to set to false. If you do so, this blueprint doesn’t work as the actions are different.

Thanks for this blueprint
Somewhat off topic question but does anyone know where to get the latest firmware for this device? I don’t seem to get a response when searching I’m Zigbee2mqtt!
Thanks

Hey, thanks for the blueprint. To get it to work with legacy set to false I had to change the actions in the script: osram_switch_mini_zigbee2mqtt.yaml · GitHub

blueprint:
  name: Zigbee2MQTT - OSRAM Smart+ switch mini (AC0251100NJ/AC0251600NJ/AC0251700NJ) actions
  description: >
    Define actions for your OSRAM Smart+ switch mini  using Zigbee2MQTT.
    For your button entity, choose the right sensor with your button name and the entity id which ends with '_action', e.g. 'sensor.kitchen.switch_action'
  domain: automation
  input:
    button_sensor:
      name: OSRAM Smart+ switch mini  sensor entity
      description: Sensor for OSRAM Smart+ switch mini to use (Use sensor with entity_id ends with _action)
      selector:
        entity:
          domain: sensor
          integration: mqtt
          multiple: false
    remote_button_up:
      name: Up Press
      description: Action to run on up press
      default: []
      selector:
        action:
    remote_button_up_hold:
      name: Up Hold
      description: Action to run on up hold
      default: []
      selector:
        action:
    remote_button_up_down_release:
      name: Up or Down Release
      description: Action to run on up or down release release
      default: []
      selector:
        action:
    remote_button_circle:
      name: Circle Press
      description: Action to run on circle press
      default: []
      selector:
        action:
    remote_button_circle_hold:
      name: Circle Hold
      description: Action to run on circle hold
      default: []
      selector:
        action:
    remote_button_circle_release:
      name: Circle Release
      description: Action to run on circle release
      default: []
      selector:
        action:
    remote_button_down:
      name: Down Press
      description: Action to run on down press
      default: []
      selector:
        action:
    remote_button_down_hold:
      name: Down Hold
      description: Action to run on down hold
      default: []
      selector:
        action:

mode: restart
max_exceeded: silent

# Each option is explicitly defined as a trigger because sensor reports empty values as well. 
# Not defining explicit triggers causes the automation to show up in the log multiple times per button press.
trigger:
  - platform: state
    entity_id: !input button_sensor
    to: 'on'
  - platform: state
    entity_id: !input button_sensor
    to: 'brightness_move_up'
  - platform: state
    entity_id: !input button_sensor
    to: 'brightness_stop'
  - platform: state
    entity_id: !input button_sensor
    to: 'brightness_move_to_level'
  - platform: state
    entity_id: !input button_sensor
    to: 'move_to_saturation'
  - platform: state
    entity_id: !input button_sensor
    to: 'hue_stop'
  - platform: state
    entity_id: !input button_sensor
    to: 'off'
  - platform: state
    entity_id: !input button_sensor
    to: 'brightness_move_down'

action:
  - variables:
      action: "{{ trigger.to_state.state }}"

  - choose:
      - conditions: "{{ action == 'on' }}"
        sequence: !input remote_button_up
      - conditions: "{{ action == 'brightness_move_up' }}"
        sequence: !input remote_button_up_hold
      - conditions: "{{ action == 'brightness_stop' }}"
        sequence: !input remote_button_up_down_release
      - conditions: "{{ action == 'brightness_move_to_level' }}"
        sequence: !input remote_button_circle
      - conditions: "{{ action == 'move_to_saturation' }}"
        sequence: !input remote_button_circle_hold
      - conditions: "{{ action == 'hue_stop' }}"
        sequence: !input remote_button_circle_release
      - conditions: "{{ action == 'off' }}"
        sequence: !input remote_button_down
      - conditions: "{{ action == 'brightness_move_down' }}"
        sequence: !input remote_button_down_hold

They are now according to what the Zigbee2MQTT docs are saying: OSRAM AC0251100NJ/AC0251600NJ/AC0251700NJ control via MQTT | Zigbee2MQTT

Triggered action (e.g. a button click). Value can be found in the published state on the action property. It’s not possible to read (/get) or write (/set) this value. The possible values are: on, brightness_move_up, brightness_move_down, brightness_stop, color_temperature_move, hue_move, hue_stop, move_to_saturation, off, brightness_move_to_level.

This also means, that there is no more separate up or down release actions only a single up and down release (brightness_stop).

hi, it seems like this blueprint break with the z2m 2.0 update.
any chance you could update this?

I know what the issue is and I’ve fixed it for other device blueprints already. I will fix it probably tomorrow.

I created a new version of the blueprint but I can’t test it. Im not going to use this device anymore. This stupid bug killed my whole house twice because it turned off all the smart plugs when pressing the down button lol…

If someone wants to test the new blueprint here’s the yaml:

blueprint:
  name: Zigbee2MQTT - OSRAM Smart+ switch mini (AC0251100NJ/AC0251700NJ) actions
  description: >
    Define actions for your OSRAM Smart+ switch mini  using Zigbee2MQTT.
    This blueprint requires a MQTT topic for your button and the actions you want to take for each button press type.  domain: automation
  domain: automation
  author: freakshock88
  homeassistant:
    min_version: "2024.10.0" # Due to updated trigger syntax
  input:
    mqtt_topic:
      name: OSRAM Smart+ switch mini MQTT topic
      description: MQTT topic for OSRAM Smart+ switch mini. e.g. "zigbee2mqtt/Osram Remote Kitchen"
    remote_button_up:
      name: Up Press
      description: Action to run on up press
      default: []
      selector:
        action:
    remote_button_up_hold:
      name: Up Hold
      description: Action to run on up hold
      default: []
      selector:
        action:
    remote_button_up_release:
      name: Up Release
      description: Action to run on up release
      default: []
      selector:
        action:
    remote_button_circle:
      name: Circle Press
      description: Action to run on circle press
      default: []
      selector:
        action:
    remote_button_circle_hold:
      name: Circle Hold
      description: Action to run on circle hold
      default: []
      selector:
        action:
    remote_button_circle_release:
      name: Circle Release
      description: Action to run on circle release
      default: []
      selector:
        action:
    remote_button_down:
      name: Down Press
      description: Action to run on down press
      default: []
      selector:
        action:
    remote_button_down_hold:
      name: Down Hold
      description: Action to run on down hold
      default: []
      selector:
        action:
    remote_button_down_release:
      name: Down Release
      description: Action to run on down release
      default: []
      selector:
        action:

mode: restart
max_exceeded: silent

# Each option is explicitly defined as a trigger because sensor reports empty values as well.
# Not defining explicit triggers causes the automation to show up in the log multiple times per button press.
trigger:
  - trigger: mqtt
    topic: !input mqtt_topic
    payload: "up"
    value_template: "{{ value_json.action }}"
    id: "up"
  - trigger: mqtt
    topic: !input mqtt_topic
    payload: "up_hold"
    value_template: "{{ value_json.action }}"
    id: "up_hold"
  - trigger: mqtt
    topic: !input mqtt_topic
    payload: "up_release"
    value_template: "{{ value_json.action }}"
    id: "up_release"
  - trigger: mqtt
    topic: !input mqtt_topic
    payload: "circle_click"
    value_template: "{{ value_json.action }}"
    id: "circle_click"
  - trigger: mqtt
    topic: !input mqtt_topic
    payload: "circle_hold"
    value_template: "{{ value_json.action }}"
    id: "circle_hold"
  - trigger: mqtt
    topic: !input mqtt_topic
    payload: "circle_release"
    value_template: "{{ value_json.action }}"
    id: "circle_release"
  - trigger: mqtt
    topic: !input mqtt_topic
    payload: "down"
    value_template: "{{ value_json.action }}"
    id: "down"
  - trigger: mqtt
    topic: !input mqtt_topic
    payload: "down_hold"
    value_template: "{{ value_json.action }}"
    id: "down_hold"
  - trigger: mqtt
    topic: !input mqtt_topic
    payload: "down_release"
    value_template: "{{ value_json.action }}"
    id: "down_release"

action:
  - choose:
      - conditions:
          - condition: trigger
            id: "up"
        sequence: !input remote_button_up
      - conditions:
          - condition: trigger
            id: "up_hold"
        sequence: !input remote_button_up_hold
      - conditions:
          - condition: trigger
            id: "up_release"
        sequence: !input remote_button_up_release
      - conditions:
          - condition: trigger
            id: "circle_click"
        sequence: !input remote_button_circle
      - conditions:
          - condition: trigger
            id: "circle_hold"
        sequence: !input remote_button_circle_hold
      - conditions:
          - condition: trigger
            id: "circle_release"
        sequence: !input remote_button_circle_release
      - conditions:
          - condition: trigger
            id: "down"
        sequence: !input remote_button_down
      - conditions:
          - condition: trigger
            id: "down_hold"
        sequence: !input remote_button_down_hold
      - conditions:
          - condition: trigger
            id: "down_release"
        sequence: !input remote_button_down_release

I can edit the opening post if someone reports to me that it works.

Hi, I tested you updated blueprint and it does not work since the payloads are named differently.
Not sure if that’s zigbee2mqtt in general or also part of the update :smile:

The correct values are:


triggers:
  - trigger: mqtt
    topic: !input mqtt_topic
    payload: "on"
    value_template: "{{ value_json.action }}"
    id: up
  - trigger: mqtt
    topic: !input mqtt_topic
    payload: brightness_move_up
    value_template: "{{ value_json.action }}"
    id: up_hold
  - trigger: mqtt
    topic: !input mqtt_topic
    payload: brightness_stop
    value_template: "{{ value_json.action }}"
    id: up_release
  - trigger: mqtt
    topic: !input mqtt_topic
    payload: brightness_move_to_level
    value_template: "{{ value_json.action }}"
    id: circle_click
  - trigger: mqtt
    topic: !input mqtt_topic
    payload: move_to_saturation
    value_template: "{{ value_json.action }}"
    id: circle_hold
  - trigger: mqtt
    topic: !input mqtt_topic
    payload: "off"
    value_template: "{{ value_json.action }}"
    id: down
  - trigger: mqtt
    topic: !input mqtt_topic
    payload: brightness_move_down
    value_template: "{{ value_json.action }}"
    id: down_hold
  - trigger: mqtt
    topic: !input mqtt_topic
    payload: brightness_stop
    value_template: "{{ value_json.action }}"
    id: down_release

Also there does not seem to be any payload for circle release, so I left it out.

The values above are working for my osram switch on the newest updates for z2m and HA

Thanks for testing and fixing the triggers :slight_smile: I’ve updated the opening post and the gist.