No actions received with Niko dimmer switch (green power) and Zigbee2MQTT

Hi,

I’m relatively new to Home Assistant and new to Zigbee and Zigbee2MQTT.
I’ve so far set up 50 or so zigbee devices using the Zigbee2MQTT add-on and that works well. I’m using a Conbee II stick.

Now I’m having some trouble getting a Niko 91004 (Green power) to work and would appreciate some help.

I’ve got it to join successfully and tried to join both to the controller and to a nearby hue bulb. I’ve factory reset it multiple times (link to docs) and had it re-join.

Zigbee2MQTT says successfully interviewed, but nothing happens when I click any button. There’s nothing in the debug log of Z2M and a test automation I made doesn’t trigger:

alias: Test Niko lysbryter
description: ''
trigger:
  - platform: state
    entity_id: sensor.soverom_vilde_lysbryter_action
condition: []
action:
  - service: notify.mobile_app_ipho
    data:
      message: Niko trykket
mode: single

The switch was working fine when I used the hue hub before switching to Zigbee2MQTT.

Hi,

I just had the same issue. The Niko dimmer switch was appearing as paired in Zigbee2MQTT, but the logs inside the Zigbee2MQTT UI were not showing anything when I was pushing the buttons, and I could not select any state or action for the device in the automations UI.

I did reset it and repair it a few times, and it didn’t solve the issue. What happened is that I wasn’t resetting it properly to factory setting and initially, I must have pressed the wrong buttons during step 3.2 of the pairing (see below).

So here is what I did and it solved my issue:

  1. Force remove the switch from Zigbee2MQTT

  2. Reset the Niko Dimmer Switch to factory setting. This part is bit tricky.
    I ended up taking the Niko Switch appart, removing the frame and the caps and extracting the Enocean PTM216Z module. With the small module on a flat table (caps removed):

  • with 4 fingers : press the 4 contact buttons simultaneously for at least 7 seconds
  • with the other hand : keep activating the power bar during at least 7 seconds

This sentence from the documentation helped me understand that the contact and the energy bar where 2 different things;

A button can be pressed by holding the contact of that button and then push the energy bar.

  1. Repair the Niko Switch to Zigbee2MQTT. Be sure to respect the 2 steps:
  • 3.1 long press one button only according to your Zigbee channel (in my case, button B1 : Top Right for Channel 11)
  • 3.2 press A0 and B1 together once it’s paired.
  1. Here comes the trick : press all combinations of buttons so that MQTT Discovery can register all actions to Home Assistant !

I found that after pairing, I had to press all combinations of buttons for MQTT discovery to register all possible actions to HA, so they would become available in the HA automatio UI.
The best way to check this is to go in Zigbee2MQTT Logs, press all combinations of buttons and you should see them appear in the logs.

If you get nothing in the Zigbee logs when you press the buttons, you need to unpair, and reset to factory settings again, and pair it again.

  1. Check in the automation UI that you have all actions / trigger available
    You should get something like that

Note: I really like this Niko Switch as it has soo many features ! I previously had this Niko Switch with a Conbee 2 and then with a Philips Hue Bridge. With the Philips Bridge everything worked out of the box nicely indeed. With Phoscon / Conbee, the pairing and the automations to switch some lights on were nice to set up, but the issue was that the deCONZ coordinator software doesn’t implement yet relaying of greenpower telegrams over bulbs, so it would only work if the Niko Switch, the bulbs and the concentrator are in direct range. In my case, due to range issue, I needed to relay the greenpower telegrams over several Philipps Hue bulbs to get to where I want. It appears that the Zigbee coordinator software needs to support this feature and the bulb firmware as well. As far as I know, only the Philipps Hue Bridge and Zigbee2Mqtt implement relaying greenpower telegrams over (Philips Hue) bulbs. I tested relaying with various non Hue bulbs as well, but I could only relay the greenpower telegrams with Philipps Hue bulbs. For more info see Niko Smart Switch PTM 215Z (EnOcean) not repeated by Hue Bulbs to Raspbee II · Issue #2780 · dresden-elektronik/deconz-rest-plugin · GitHub.

The tradeoff with using Z2M and HA with the Niko Dimmer Switch is that automations are a little harder to implement. For instance, I haven’t figured out yet how to implement dimming by subsequent pressing of the same button. If any one managed to replicate “Hue Style” dimming automations for the Niko Dimmer Switch, I am interested !

Wow, what a good and detailed answer, thanks :pray:

I’ll try again following your steps as soon as I get the chance. I thought I reset the switch several times, but as you say it wasn’t easy to figure out the key presses, so probably I didn’t do it correctly.

1 Like

Finally managed to get it working :slight_smile:
3.2 from your instructions was the step I was missing from my first attempts. Tried a few times without success, but figured out it should be A1 and B0, not A0 and B1.
Now I can finally start some automations with this switch.

Basic automation for on off etc. was quite simple to get working for a couple of lights:

alias: Test Soverom XX lysbryter
description: ''
trigger:
  - platform: state
    entity_id: sensor.soverom_xx_lysbryter_action
    attribute: action
condition: []
action:
  - choose:
      - conditions:
          - condition: template
            value_template: '{{ trigger.to_state.attributes.action == "recall_scene_0"}}'
        sequence:
          - service: light.turn_on
            target:
              entity_id: light.soverom_xx_leselys
      - conditions:
          - condition: template
            value_template: '{{ trigger.to_state.attributes.action == "recall_scene_1"}}'
        sequence:
          - service: light.turn_off
            target:
              entity_id: light.soverom_xx_leselys
      - conditions:
          - condition: template
            value_template: '{{ trigger.to_state.attributes.action == "recall_scene_3"}}'
        sequence:
          - service: light.turn_on
            target:
              entity_id: light.soverom_xx_taklys
      - conditions:
          - condition: template
            value_template: '{{ trigger.to_state.attributes.action == "recall_scene_2"}}'
        sequence:
          - service: light.turn_off
            target:
              entity_id: light.soverom_xx_taklys
    default: []
mode: single

However, it seems to be difficult to distinguish between click and hold actions, to set dimming automations. These are the actions I get:

Button Click Hold Release
Top left (A0) recall_scene_0
recall_scene_4
recall_scene_0 recall_scene_4
Bottom left (A1) recall_scene_1
recall_scene_5
recall_scene_1 recall_scene_5
Top right (B0) recall_scene_3
recall_scene_7
recall_scene_3 recall_scene_7
Bottom right (B1) recall_scene_2
recall_scene_6
recall_scene_2 recall_scene_6
Top both press_2_of_2
release_2_of_2
press_2_of_2 release_2_of_2
Bottom both press_1_of_2
release_1_of_2
press_1_of_2 release_1_of_2

Since the same actions (as for hold and release) are sent on a single click, it’s more difficult to make automations for example for dimming when holding button.

Maybe ControllerX would be a simpler way to automate this switch. I’ll have a look.

Hi @Kristian

after updating Z2M to version 1.21.2, all actions were renamed. For instance recall_scene_X will not work anymore. See https://github.com/Koenkk/zigbee2mqtt/releases/tag/1.21.2.

In the release notes they updated the green power behaviours

you’ll see the new action names in this commit in particular:

The Niko Switch is now identified as Manufacturer EnOcean Model PTM 215Z

It got me confused because this change happened the day after I responded to you, and all my automations using “recall_scene_XX” stopped working !

I updated my automation using the new action names and it works perfectly now:
‘press_1’,
‘release_1’,
‘press_2’,
‘release_2’,
‘press_3’,
‘release_3’,
‘press_4’,
‘release_4’,
‘press_1_and_3’,
‘release_1_and_3’,
‘press_2_and_4’,
‘release_2_and_4’,
‘press_energy_bar’,

1 Like

Thanks, noticed that as well :slight_smile:

This massive automation seems to work and allow hue-style dimming, but being new to Home Assistant it feels unnecessarily complex :upside_down_face:

alias: Test Soverom Vilde lysbryter
description: ''
trigger:
  - platform: state
    entity_id: sensor.soverom_vilde_lysbryter_action
    attribute: action
condition: []
action:
  - choose:
      - conditions:
          - condition: template
            value_template: '{{ trigger.to_state.attributes.action == "press_1"}}'
        sequence:
          - service: light.turn_on
            target:
              entity_id: light.soverom_vilde_leselys
          - service: mqtt.publish
            data:
              topic: zigbee2mqtt/Soverom Vilde leselys/set
              payload: '{ "brightness_move": 40 }'
      - conditions:
          - condition: template
            value_template: '{{ trigger.to_state.attributes.action == "release_1"}}'
        sequence:
          - service: mqtt.publish
            data:
              topic: zigbee2mqtt/Soverom Vilde leselys/set
              payload: '{ "brightness_move": 0 }'
      - conditions:
          - condition: template
            value_template: '{{ trigger.to_state.attributes.action == "press_2"}}'
        sequence:
          - wait_for_trigger:
              - platform: state
                entity_id: sensor.soverom_vilde_lysbryter_action
                to: release_2
                id: release_2
            timeout: '00:00:01'
          - choose:
              - conditions:
                  - condition: template
                    value_template: '{{ wait.trigger.id == "release_2" }}'
                sequence:
                  - service: light.turn_off
                    target:
                      entity_id: light.soverom_vilde_leselys
            default:
              - service: mqtt.publish
                data:
                  topic: zigbee2mqtt/Soverom Vilde leselys/set
                  payload: '{ "brightness_move": -40 }'
              - wait_for_trigger:
                  - platform: state
                    entity_id: sensor.soverom_vilde_lysbryter_action
                    to: release_2
                    id: release_2_2
                timeout: '00:00:10'
              - choose:
                  - conditions:
                      - condition: template
                        value_template: '{{ wait.trigger.id == "release_2_2" }}'
                    sequence:
                      - service: mqtt.publish
                        data:
                          topic: zigbee2mqtt/Soverom Vilde leselys/set
                          payload: '{ "brightness_move": 0 }'
                default:
                  - service: mqtt.publish
                    data:
                      topic: zigbee2mqtt/Soverom Vilde leselys/set
                      payload: '{ "brightness_move": 0 }'
      - conditions:
          - condition: template
            value_template: '{{ trigger.to_state.attributes.action == "press_3"}}'
        sequence:
          - service: light.turn_on
            target:
              entity_id: light.soverom_vilde_taklys
          - service: mqtt.publish
            data:
              topic: zigbee2mqtt/Soverom Vilde taklys/set
              payload: '{ "brightness_move": 40 }'
      - conditions:
          - condition: template
            value_template: '{{ trigger.to_state.attributes.action == "release_3"}}'
        sequence:
          - service: mqtt.publish
            data:
              topic: zigbee2mqtt/Soverom Vilde taklys/set
              payload: '{ "brightness_move": 0 }'
      - conditions:
          - condition: template
            value_template: '{{ trigger.to_state.attributes.action == "press_4"}}'
        sequence:
          - wait_for_trigger:
              - platform: state
                entity_id: sensor.soverom_vilde_lysbryter_action
                to: release_4
                id: release_4
            timeout: '00:00:01'
          - choose:
              - conditions:
                  - condition: template
                    value_template: '{{ wait.trigger.id == "release_4" }}'
                sequence:
                  - service: light.turn_off
                    target:
                      entity_id: light.soverom_vilde_taklys
            default:
              - service: mqtt.publish
                data:
                  topic: zigbee2mqtt/Soverom Vilde taklys/set
                  payload: '{ "brightness_move": -40 }'
              - wait_for_trigger:
                  - platform: state
                    entity_id: sensor.soverom_vilde_lysbryter_action
                    to: release_4
                    id: release_4_2
                timeout: '00:00:10'
              - choose:
                  - conditions:
                      - condition: template
                        value_template: '{{ wait.trigger.id == "release_4_2" }}'
                    sequence:
                      - service: mqtt.publish
                        data:
                          topic: zigbee2mqtt/Soverom Vilde taklys/set
                          payload: '{ "brightness_move": 0 }'
                default:
                  - service: mqtt.publish
                    data:
                      topic: zigbee2mqtt/Soverom Vilde taklys/set
                      payload: '{ "brightness_move": 0 }'
    default: []
mode: single

2 Likes