Zigbee2MQTT enOcean PTM 215Z (Friends of Hue) switch

I think my issue is that the payload is not what the blueprint from @vandalon expects.

In the blueprint I see:

- condition: template
  value_template: "{{\n  ('release_' in trigger.payload_json.action and trigger.payload_json.elapsed
    is defined)\n  or 'press_' in trigger.payload_json.action\n}}\n"

But I don’t see the ‘elapsed’ using MQTT explorer.

Had to configure this in Z2M: MQTT Topics and Messages | Zigbee2MQTT

Now I see elapsed and is the blueprint working as expected. Will do some tests with groups now.

1 Like

@tokaz when I target a Z2M light group, the blueprint works fine with the group.

1 Like

Thanks. Finally got it to work. I don’t know if it would have worked with the other option for grouping I used in the first place. I could pair the switch but it didn’t reacted to my push actions. Then I tried another switch it was exactly the same. Then I tried the switch I used for the first automation and i turn on and off the light instantly. So the problem was the channel. I changed it to 11 as my setup and it responded immediately :slight_smile:

Do you have an idea to controlling Hue GU-10 White Ambiance in the same code. ex. button 1 and 2 for on and off and then button 3 and 4 for cycle up and down between Bright, Dimmed, Night-Light, Adaptive and so on?

@vandalon

Thanks for this Blueprint! Al works as expected.
But for al my FoH switches I get a warning in the log:

2023-11-23 13:48:46.746 WARNING (MainThread) [homeassistant.components.automation] Error evaluating condition in ‘FoH Switch - Hal Binnendeur’:

In ‘condition’:

In ‘template’ condition: TypeError: argument of type ‘NoneType’ is not iterable

Anyone been looking into the gap between “press” and “release”.

I was looking into switching from the hue hub to Z2M for these switches as I was annoyed there were a ~1 sec gap between the press and release actions.

Integrating the switch into Z2M revealed that there is the same gap, hence it must be in the switch or somewhere else in my system.

I get the same flow every time.

  • Press
  • below 10ms later a “blank” message"
  • App 900ms later I get the “release” message
  • below 10ms after release I get a “blank”

Anyone else having this issue.

I would like/expect the release to be triggered right after I release the button.

EDIT: Just tested the same on a Hue Tap Switch, using Z2M. Time between press and release is below 200ms. It might be the switch not beeing fast

Can this blueprint be done with at double click also, please???

1 Like

Can’t believe I’ve only just found this!!

I’ve had about 10 of these in my house for at least a year, where I had them connected through a Hue bridge to control some Hue lights, which was all integrated via the Hue integration. Now I can ditch the hub, and have all my Hue stuff directly in Z2M :smiley:

However, there is one thing I’m missing, when compared to the way they worked via the Hue bridge. Is it possible to stop the lights from turning off, when dimming all the way down (or should I say, below) 0% brightness?

Otherwise, it works great!!

3 Likes

Hi, thanks a lot for your work!
I´m struggling with my PTM 215Z. The Button is integrated, but there are noch actions (see below). The Bluepint isn´t working, too. Is that normal, that there are no information regading the actions?

Remove the spaces from the device name, then the blueprint should work.

@rondol1

Hi!

I have the same problem. Have you found a solution for this and would like to share it with me? That would help me a lot. Thank you in advance.

Might be because you have not enabled elabsed time.

Cut/paste from OP
Make sure you enable Elapsed in the z2m advanced settings. This is used to prevent a release after a short press to restart the automation prematurely.

Hey @khvej8 as I wrote to you in a direct message, Elapsed is enabled in z2m. I am very satisfied with the blueprint because the automations run as desired and without errors. This warning message only exists after a complete system restart. I think it’s because if Home Assistant is completely restarted and reloads the automations while z2m or MQTT are not yet ready, the error message occurs.

I’ve created a separate topic about this here. I wish @vandalon would take a look at this and maybe could help:

I found a solution. Maybe it will help someone:

I can’t get this to work. Is there a way to test whether HOA correctly receives the signal from the FoH switches?

I have two switches paired (I think they are paired? How should this look):

With two automations for desperate attempts at getting this to work:

alias: Wohnzimmerschalter_Bogen
description: ""
use_blueprint:
  path: vandalon/z2m EnOcean PTM 215Z (Friends of Hue) switch.yaml
  input:
    button_1_pressed:
      - service: light.turn_on
        target:
          entity_id: light.wohnzimmerdecke
        data: {}
    button_2_pressed:
      - service: light.turn_off
        target:
          entity_id: light.wohnzimmerdecke
        data: {}
    controller: FoHWohnzimmer
alias: FoH Test
description: ""
use_blueprint:
  path: vandalon/z2m EnOcean PTM 215Z (Friends of Hue) switch.yaml
  input:
    button_1_pressed:
      - service: light.toggle
        target:
          entity_id: light.wohnzimmerdecke
        data: {}
    controller: FoHTester

Nothing happens in any button press though. Any help is greatly appreciated!

You need to set the 2 fields called controller and basetropic in the blueprint. Otherwise it does not know what to listen for.

I’m not sure I understand. I set a controller field in both my automations (as you can see in the code blocks that I posted).
What is the basetropic field? I can see no reference to such a field in this thread or any home assistant documentation.

You say that I need to set these fields in the blueprint. Does that mean I have to edit the blueprint file or the automations?

You controller input is not the first, in my automation it is the first one. Strange, are there more different versions.

  input:
    controller: yourswitchname

if your topic is “zigbee2mqtt”, then OK, otherwise this also needs to be defined

Testing out the blueprint and I have major issues. I put switch on a light on release 1 und switch off that light on release 3. It generally works but I sometimes have to press 3 times until something happens. It is really unreliable. I thought it was the switch itself that it does not transmit. However I tested by creating two normal automations one switch on and the other one switch off. With those it works every time without issue.

So it must be a problem in the blueprint. Any idea what is causing it?

Thanks

I had the same experience. Was in doubt to ditch al those FoH switches.

I stopped using the blueprint and created an automation based on this: Home Assistant | Zigbee2MQTT

So only on/off support for now. I manage my lights with the Adaptive Lighting integration.

The biggest win is that my switches now respond instant with no missed actions.

Tried creating a new blueprint based on this but it seems impossible to get the correct device_id using the default inputs.

Have a look at my post to get the most of the Zigbee2MQTT way