Philips Hue Tap Dial Switch - ZHA

Instructions for OTA updates are here:

Basically you add this to your configration.yaml, add the FW file there and reboot:

zha:
  zigpy_config:
    ota:
      otau_directory: /path/to/your/ota/folder

It was a bit unclear to me though how to trigger the update. I.e. should the device do it automatically. I did eventually use the zha toolkit’s ota_notify for it:

But I’m not sure if that was needed. It took 34 minutes(!) for the FW to be uploaded to the Tap Dial. And maybe 25% of the battery.

The FW link is mentioned here:

I didn’t rename it, just copied it to the ota directory I created.

2 Likes

Thank you for blueprint.
Is there and option to execute script?

Or can I create Automation and handle events like First button clicked, hold down, rotate left, rotate right wit amount of rotate?

I prefer to use button for scenes or script and hold function to control my blinds.

I can do it if i integrate it intk Hue Bridge, but there is no option to see how fast I rotated.

This one cannot be used for scripts as it uses the toggle service. But there was a variation made which calls full actions here.

There is a parameter which comes in from a spin that tells you how much spin to a degree. You can look at the dimming part of this blueprint for reference.

Amazing. Thank you for link.
That variations is good.
I just missing 2 options. Is there a way how can i create it?

  1. I dont want to turn off light to dim level 0. I prefere to 1%.

  2. I would like to setup dial options.
    Scenario: When light is off and when I turn dial left, i want turn on light to level 1%. WHen I turn right, I want 100%.
    So I just miss function to add action when you dial clockwise or counterclockwise.

Yes, that would be great indeed. So +1

The blueprint says “no compatible device was found”.
Dont really know what i’m doing wrong…?
The buttons work in regular automations.

ZHA, never mind, i need to learn… A lot :slight_smile:

It might be obvious but I’m really new to all this. I know the script only works for ZHA.
I have my Tap Dial visible in HA through the Philips Hue bridge. What exactly do I need to change to the blueprint to make it work for that type of integration?

The device filtering might need to change (not sure as I don’t have a Huge bridge). Then all the event triggers as well as event data would need adjusted to however the Hue events come through HA.

Can be blueprint adjus to work with zigbee2mqtt device?
So far this is best solution for Philips Tap Dial Switch.

Probably. I don’t use that and have no experience with it. But I don’t see any reason someone couldn’t adjust this to work with it.

@apollo1220 Thank your very much for sharing this very useful blueprint. It works like a charm. I have one question and would like to ask if you could give me a hint as to how I might be able to alter the blueprint to change the current behavior:

when I want to dim any of the 4 lights and the light is already on, it is first turned off when I select it before I can start dimming it.

How can I add a condition to check if the light I switch to is already on and if so leave it on and just enable dimming via the dial?

Thanks!

For each of the recall cases in the actions, you would need to add a choose or if-then which checks the lights current state first. If it’s on, just do the part where it sets the selected light.

Or even easier, just change the toggle service call to a turn_on service call. Then you would always have to turn off via dimming, but it wouldn’t turn off when you press.

1 Like

Thanks for the hint. I would like to be able to also toggle the lights with the button press so I am trying to implement the choose action but alas I am having a very rough time getting the choose part right. I tried vairous options but can’t get my head wraped around it. Would you be so kind and give me some more guidance?

  - choose:
      - conditions:
          - "{{ command == 'recall' }}"
          - "{{ scene == 1 }}"
        sequence:
          - choose:
            - conditions: "{{ is_state(!input 'first_light', 'off') }}"
              sequence:
                - service: homeassistant.toggle
                  target: !input "first_light"
          - choose:
              - conditions: "{{ current_light != none }}"
                sequence:
                  - service: input_text.set_value
                    target:
                      entity_id: !input "current_light"
                    data:
                      value: first_light

I would change it a bit. For the condition you have checking for the first_light being off, I would make that an AND for both the first_light being on and current_light being anything other then first_light. Then that would set current_light to first_light. Then you can fall through on the second choose to just toggle the first_light.

So that should result in, first_light is off, it will turn on.
First_light is on, but current_light isn’t first_light, current_light becomes first_light (enabling dimming)
First_light is on, but current_light is first_light, first_light will turn off.

I’d write out the formatted code, but I’m at work and don’t have time :grin:

1 Like

Thank you very much for your support and patiences. The logic makes sense but I am struggeling with the correct yaml formating and choose sequence syntax.

I currently have:

  - choose:
      - conditions:
          - "{{ command == 'recall' }}"
          - "{{ scene == 1 }}"
        sequence:
          - choose:
            - conditions: "{{ is_state(!input 'first_light', 'on') }}"
            - conditions: "{{ current_light != first_light }}"
              sequence:
                - service: input_text.set_value
                  target:
                    entity_id: !input "current_light"
                  data:
                    value: first_light   
          - choose:
              - conditions: "{{ current_light != none }}"
                sequence:
                  - service: homeassistant.toggle
                    target: !input "first_light"

But get the following error in the logs:

Blueprint Philips Tap Dial Switch Dim generated invalid automation with inputs OrderedDict([('remote', '155716c88273e5ca8560480cac6109c2'), ('first_light', OrderedDict([('entity_id', 'light.esstisch')])), ('second_light', OrderedDict([('entity_id', 'light.kuche')])), ('third_light', OrderedDict([('entity_id', 'light.wohnzimmer')])), ('current_light', 'input_text.philips_tab_dial_switch_helper')]): Expected a dictionary @ data['action'][1]['choose'][0]['sequence'][0]['choose'][0]['conditions'][0]. Got None extra keys not allowed @ data['action'][1]['choose'][0]['sequence'][0]['sequence']. Got None required key not provided @ data['action'][1]['choose'][0]['sequence'][0]['choose'][0]['sequence']. Got None

@ufulu you’re really close

  - choose:
      - conditions:
          - "{{ command == 'recall' }}"
          - "{{ scene == 1 }}"
        sequence:
          - choose:
            - conditions:
                - "{{ is_state(first_light, 'on') }}"
                - "{{ current_light != 'first_light' }}"
              sequence:
                - service: input_text.set_value
                  target:
                    entity_id: !input "current_light"
                  data:
                    value: first_light

An idea: To select the device you are dimming, double-click a button.
i.e. the dial does not dim the last device but the selected one. That way you can turn on/off the rest of the devices without changing that you are dim-control the primary device. Sistem can even remember the dim levels for all devices separately.

@apollo1220 thank you so much for your support. I feel bad for not seeing that. I changed my code but none the less, no matter how often I look at it and read the error message I can’t for the life me decifer what is wrong:

Error in 'choose[0]' evaluation: In 'template' condition: AttributeError: 'dict' object has no attribute 'lower'

I only see that the input_text.set_value is never changed as the choose staement never turns true.

  - choose:
      - conditions:
          - "{{ command == 'recall' }}"
          - "{{ scene == 1 }}"
        sequence:
          - choose:
              - conditions:
                  - "{{ is_state(first_light, 'on') }}"
                  - "{{ current_light != 'first_light' }}"
                sequence:
                  - service: input_text.set_value
                    target:
                      entity_id: !input "current_light"
                    data:
                      value: first_light
          - choose:
              - conditions: "{{ current_light != none }}"
                sequence:
                  - service: homeassistant.toggle
                    target: !input "first_light"

‘lower’ doesn’t appear in the part that you posted. Does it appear somewhere else? It should, given the error. Given the error is coming from ‘choose[0]’ that should be the first sequence of the choose. I assume the whole sequence you included, so maybe it is a formatting issue and some other piece is being included which shouldn’t be.

there was no “lower” other than the word lower in your dim_scale description text, but none the less after recreating the blueprint again from scratch the error disappeard. Unfortunately the first choose still never gets executed. The automation always jups to the second toggle choose. Here the full modified blueprint in case any body has a clue: blueprints/philips_zigbee_dial.yaml at b1f247dc090f5896101f1a1091e3b43a088b51b7 · ufulu/blueprints · GitHub