Helper in YAML

Hi,

Why is this code working:

device_id: 10049f30a04454f3e2ce0226fdc3d7b8
domain: zwave_js
type: set_config_parameter
parameter: 19
bitmask: null
subtype: 19 (Forced Switch On Brightness)
value: 18

and this code isn’t:

device_id: 10049f30a04454f3e2ce0226fdc3d7b8
domain: zwave_js
type: set_config_parameter
parameter: 19
bitmask: null
subtype: 19 (Forced Switch On Brightness)
value: input_number.brightness_eettafellamp

or this:

device_id: 10049f30a04454f3e2ce0226fdc3d7b8
domain: zwave_js
type: set_config_parameter
parameter: 19
bitmask: null
subtype: 19 (Forced Switch On Brightness)
value: (input_number.brightness_eettafellamp | int)

With the not working code examples, I receive the message:

The idea is to set the Forced Switch On Brigthness based on a helper input number. But can’t find any solution to reach this -looking simple- implementation :frowning:

I don’t know where you are trying to use this but templates should be formatted like this:

value: "{{ states('input_number.brightness_eettafellamp') | int }}"
1 Like

Thanks, and sorry for my delayed answer. I did’nt receive an email notification because of your reply.

But this isn’t working either…

device_id: 10049f30a04e74f3e2ce0226fdc3d7b8
domain: zwave_js
type: set_config_parameter
parameter: 19
bitmask: null
subtype: 19 (Forced Switch On Brightness)
value: “{{ states(‘input_number.brightness_eettafellamp’) | int }}”

What I’m trying to do is simple; I would like to have a numeric input (or slider) on my dashboard named ‘settings’ where I can set default switch-on values. Doing this, I can reset the default switch-on values at midnight. But remember the light-intensity if it is changed during the day.

Again, I don’t know where you are trying to use this.
We can’t help you if you are not clear with what you are doing.

Sorry, i try to explain.

I try to run this script (setting a zwave parameter) with a actual helper value, triggered on a certain condition.

The condition in the automation works, but the action doesnt. The action works if I replace the reference to the helper value with a constant. E.g. 18.

Herewith the complete yaml code (working with a constant instead of the helper input value)

alias: Eettafellamp setpoint reset
description: ""
trigger:
  - platform: device
    device_id: 10049f30a04e74f3e2ce0226fdc3d7b8
    domain: zwave_js
    type: event.value_notification.scene_activation
    property: sceneId
    property_key: null
    endpoint: 0
    command_class: 43
    subtype: Endpoint 0
    value: 16
    alias: Enkele klik rechterschakelaar
condition: []
action:
  - device_id: 10049f30a04e74f3e2ce0226fdc3d7b8
    domain: zwave_js
    type: set_config_parameter
    parameter: 19
    bitmask: null
    subtype: 19 (Forced Switch On Brightness)
    value: 18
mode: single

Thus,
I have a helper:

And I have a Zwave device with parameters, and here is parameter #19:

Now, I would like to have an automation.

  • The trigger of that automation is ‘Helper value changed’.
  • The action of that automation is 'configure zwave device parameter 19 with [helper value].

But that doesn’t work.

@Hellis81 is this still unclear?

I don’t use zwave so I can’t help with that.
But is there no service call you can use? Device actions are not something I usually recommend.

I have the same problem.

There is a door which blinds shall be closed after a delay (usually 1 min, is a timer helper). The delay is to give someone time to get in after the signal came that the blinds will close (other blinds closing probably will suffice). The position depends on the purpose. If the blinds shall close for the night, the position will be 0. If the blinds close for glare shield, the position will be 15. So the position will be defined by a helper. But I don’t get the right syntax to use the helper for the position.

alias: Rolladen Terrasse Position setzen
sequence:
  - device_id: ba7afe27e8e833f15c8b2426ded1d746
    domain: cover
    entity_id: 5b972e4e8e8c28ffc26f5f3e3c37c4a0
    type: set_position
    position: "{{ states('input_number.rolladen_terrasse_zielposition') | int }}"
description: ""

If I enter position: 10 everything works fine, but as soon as I try to evaluate the helper, it gives Message malformed: value must be one of ['close', 'close_tilt', 'open', 'open_tilt', 'stop'] for dictionary value @ data['type']

Which is the right syntax for this purpose, so that the value of that helper is being used for the position?

Edit: Found it. Still don’t understand why set_position is invalid when using a variable but valid when using a number, but calling the
service: cover.set_cover_position does help using a variable for the purpose.