Help wanted with setting up automation (paid)

Hi everyone.
I’ve been struggling for quite some time with setting up automation for some zigbee devices using Z2M (seems there are more ZHA automation blueprints than Z2M blueprints). I also struggle with mixing zigbee devices to control Yeelight (Xiaomi) devices.

Example: I have the MOES Tuya Smart Knob (ERS-10TZBVK-AA) and I can’t use all of its functions to automate stuff. If I want to rotate left/right to increase/decrease brightness… that’s not a straight forward automation. whatever I tried, didn’t work.

Same thing goes for the IKEA Tradfri switch.

I came to a point where I have more zigbee devices that doing nothing because I can’t seem to set up automation for them.
I can only utilize a very small percentage of the GUI for setting up automation. As for using YAML, even after reading the automation guides, I’m not smart enough to figure them out

Is there anyone here who is capable of spending time helping me out setting automation for some of my devices for a paid service ?

Mod: apologies in advance if this is not the place to ask for such a thing. Please delete if required.

There’s a (Z2M) blueprint for it; have you tried it?

There are several blueprints for Tradfri devices. What’s its model name?

Have you considered the option of personally automating your home using a commercial (paid) product (like Hubitat Elevation) instead of paying others to do it using free software?

Yes. It doesn’t work well. It doesn’t allow for all the functions of the smart knob and in addition, it keeps throwing out errors like Stopped because only a single execution is allowed and even after reading about it, I can’t figure out how to fix it.

Same goes for the Tradfri devices. That’s the model: E1743

Never heard of that. Had I known of that solution previously, I might have taken it. I knew there’s going to be a learning curve with HA, but I never thought automation would be impossible for devices that support zigbee.

Which functions are missing from blueprints for the Smart Knob and E1743?

The error message is due to the value of mode that the blueprint’s author chose. The error message can be eliminated.

Genuinely impossible or just beyond your current skill level? Can you provide an example of what’s not possible?

to start, the simple click function doesn’t work, but what’s missing is the click and rotate. not a deal breaker. can live without it for now.

how?

could be both. it is 100% out of my skill level, but it could also turn out to be impossible, which is where a pro person might figure this out.

First of all, can you confirm that the error message you mentioned above is truly coming from the linked blueprint and you’re using the latest version of it?

The reason why I ask is because it uses this:

mode: restart
max_exceeded: silent

mode: restart means that if the automation (produced by the blueprint) is triggered while it’s still busy processing a previous execution, it aborts what it’s doing and starts over. There’s no error or warning message; it simply restarts executing the automation’s action.

The inclusion of max_exceeded: silent is a bit odd in this case because it isn’t needed when using mode: restart. It’s applicable when using mode: single to suppress the error message you reported.

I don’t know how to check if I’m using the latest version. I just imported the blueprint.
I can only confirm it comes from this automation I’m trying to setup because that’s the only one running right now.

If that blueprint fails to work as advertised, you can either report it to the blueprint’s author or try creating an automation based the Smart Knob’s Device Actions.

Go to Settings > Devices & Services > Devices > Your MOE’s Smart Knob device to display all of the device’s information. Click the + icon next to Automations and it should present all the Snart Knob’s Device Actions. If the action you want isn’t displayed then Home Assistant doesn’t currently support it. Click the Device Action you want and it will lead you to the Automation Editor to continue building your automation.

but how do I configure it if there is a turn left or right to increase/decrease brightness?

The light.turn_on service call offers a brightness_step_pct option thereby allowing you to increase/decrease brightness incrementally.

I tried but it doesn’t do anything.

If you want assistance, you will need to provide far more details that merely ‘done that; doesn’t work’.

I suggest posting the automation you created and explaining how you tested it.

Additional tips, to get the best help, are listed here: FAQ

2 Likes

Can you give us an example of one of your automations please? Yaml of course.

you are correct. apologies for not sharing more info.

I’ve tried several approaches to this knob automation, some I made myself, some were a combination of things I found online.

This is example one:

alias: TEST KNOB
description: ""
trigger:
  - platform: mqtt
    topic: zigbee2mqtt/smart_knob
condition: []
action:
  - variables:
      event: "{{ trigger.payload_json.action }}"
      size: "{{ trigger.payload_json.action_step_size }}"
  - service: light.toggle
    data: {}
    target:
      entity_id: light.yeelink_color1_cb8d_light
  - service: light.turn_on
    data:
      brightness_step_pct: 10
    target:
      entity_id: light.yeelink_color1_cb8d_light
  - service: light.turn_on
    data:
      brightness_step_pct: -10
    target:
      entity_id: light.yeelink_color1_cb8d_light
mode: restart
max_exceeded: silent
max: 10

The increase/decrease brightness doesn’t work.

Traces:

Triggered by the mqtt topic zigbee2mqtt/smart_knob at August 7, 2023 at 4:20:40 PM
Define variables event and size
Call a service 'Light: Toggle' on PC light Light
(light.yeelink_color1_cb8d_light) turned off
5 seconds later
Call a service 'Light: Turn on' on PC light Light
9 seconds later
Call a service 'Light: Turn on' on PC light Light
2 seconds later
(light.yeelink_color1_cb8d_light) turned off
Stopped because of unknown reason "null" at August 7, 2023 at 4:20:56 PM (runtime: 15.39 seconds)

This one is using a blueprint:

alias: New Automation
description: ""
use_blueprint:
  path: rdeangel/zigbee2mqtt-tuya-moes-smart-knob-ers-10tzbvk-aa.yaml
  input:
    switch: sensor.smart_knob_action
    button_short_press:
      - service: light.toggle
        data: {}
        target:
          entity_id: light.0xa4c13805cd342859
    button_rotate_right:
      - service: light.turn_on
        data:
          brightness_step_pct: 10
        target:
          entity_id: light.0xa4c13805cd342859
    button_rotate_left:
      - service: light.turn_on
        data:
          brightness_step_pct: -10
        target:
          entity_id: light.0xa4c13805cd342859

The button_short_press doesn’t do anything. There’s simply no trigger.

Traces: No traces found

This one is just another shot in the dark:

alias: New Automation1
description: ""
trigger:
  - platform: device
    domain: mqtt
    device_id: 23f14bb9c488ca27cba9f11bf5b8870c
    type: action
    subtype: brightness_step_up
    discovery_id: 0xe0798dfffe9c1c40 action_brightness_step_up
condition: []
action:
  - device_id: f87d15b2b40ca31515829daab15c980d
    domain: light
    entity_id: 1e891c8cba0250124c87a1b99ad7cd43
    type: brightness_increase
mode: queued
max_exceeded: silent
max: 2

Traces:

Triggered by the mqtt topic zigbee2mqtt/smart_knob/action at August 7, 2023 at 4:37:20 PM
Stopped because maximum number of parallel runs reached at August 7, 2023 at 4:37:20 PM (runtime: 0.00 seconds)

I spotted a few errors but I have to pass the baton to someone else.


To the next person who steps in to help, be advised that the 'Stopped because of unknown reason “null” ’ error may be symptomatic of a bug affecting some automations in the July and August releases of Home Assistant.

The message itself is a bit opaque and a developer is already planning to make it clearer. However the underlying issue in this case is that the automation’s mode is restart but it fails to restart cleanly (or at all).

There’s more to it than that (some can be found here) but unfortunately that’s all the free time I have available for this topic. Good luck.

I’ve made some small progress.
I got rid of the Yeelight and installed Zigbee RGBW TuYa TS0505B_1 control via MQTT | Zigbee2MQTT

Given I’m using TuYa ERS-10TZBVK-AA control via MQTT | Zigbee2MQTT in command mode, I got this far with automation:

alias: New Automation1
description: ""
trigger:
  - platform: device
    domain: mqtt
    device_id: 23f14bb9c488ca27cba9f11bf5b8870c
    type: action
    subtype: brightness_step_up
    discovery_id: 0xe0798dfffe9c1c40 action_brightness_step_up
    id: "2"
  - platform: device
    domain: mqtt
    device_id: 23f14bb9c488ca27cba9f11bf5b8870c
    type: action
    subtype: brightness_step_down
    discovery_id: 0xe0798dfffe9c1c40 action_brightness_step_down
    id: "3"
  - platform: device
    domain: mqtt
    device_id: 23f14bb9c488ca27cba9f11bf5b8870c
    type: action
    subtype: toggle
    discovery_id: 0xe0798dfffe9c1c40 action_toggle
    id: "1"
  - platform: device
    domain: mqtt
    device_id: 23f14bb9c488ca27cba9f11bf5b8870c
    type: action
    subtype: color_temperature_step_down
    discovery_id: 0xe0798dfffe9c1c40 action_color_temperature_step_down
    id: "4"
condition: []
action:
  - if:
      - condition: trigger
        id:
          - "1"
    then:
      - service: light.toggle
        data:
          color_temp: 480
          brightness_pct: 100
        target:
          entity_id: light.0xa4c13820c8f952c4
    else:
      - if:
          - condition: trigger
            id:
              - "2"
        then:
          - device_id: b48e9b2ab0e8a164cd97214dbe06bc56
            domain: light
            entity_id: 19683080b17cc83dec3929cae15f19b8
            type: brightness_increase
        else:
          - if:
              - condition: trigger
                id:
                  - "3"
            then:
              - device_id: b48e9b2ab0e8a164cd97214dbe06bc56
                domain: light
                entity_id: 19683080b17cc83dec3929cae15f19b8
                type: brightness_decrease
          - if:
              - condition: trigger
                id:
                  - "4"
            then:
              - service: light.turn_on
                data:
                  kelvin: 5500
                target:
                  entity_id: light.0xa4c13820c8f952c4
mode: queued
max_exceeded: silent
max: 10

I’m using ID’s to condition the If/Else statements (I’m sure there’s a smarter way but I couldn’t figure it out).

Where I’m struggling is with the following:

  1. Hue_Move - using the HOLD button - how do I set this up to gradually change the hue?
  2. color_temperature_step_up which is Push+Hold and Rotate Left - I’d like to use that to control the color temp.

Can someone please assist?

EDIT:
Reading this part:

brightness move/step will stop at the minimum brightness and won’t turn on the light when it’s off. In this case use brightness_move_onoff /brightness_step_onoff

I also failed setting it up. It seems the light doesn’t quite get too dim and then all of sudden it turns off.
I would like to prevent from turning off, but also maybe have more fine control over the stepping so I can really get to the lowest light value possible?