Help trying to use an input select in a zwave set parameter

So this works
,
{
“node_id”: 82,
“parameter”: 7,
“value”: “Tamper”
}

But this does not

{
“node_id”: 82,
“parameter”: 7,
“value”: “{{states.input_select.lock_zwave_option_7.state}}”
}

But the second one shows proper in the template test area.

I can literally copy the output from the template test area into the services area and it works.

are you sure a template can go there?

No. haha, but it sure would be nice if it could. I could not find any examples of successes or failures

Oh wait a minute, are you talking about the ‘test service call’ area?

Yes, here is what I showed
that did not work

The end game is something like this

yah i don’t think that would work in the service call area because it explicitly says “service data”. I mean you could try a bunch of different things, but templates go in data_templates. You could make it work by making a script and using a data template.

EDIT: @anon43302295 might know?

Yeah, I think @petro is correct, it would work from a script/automation (which presumably is the end goal looking at the screenshot) but not in the service area because there is no facility to decode the template there.

2 Likes

I was eventually going to put this is an automation but wanted to test it first. Maybe i should have just went straight for the automation. :slight_smile:

2 Likes

Hi,
Did you get this to work ?
I’m trying to do something similar …
Change the siren music, it’s volume and to choose between alarm and doorbell modes.
Can you let me have a look at any working config you have ?
Thanks in advance
Mutt

Sorry Petro is this intended to help ? Aimed at anyone in particular ?
I think the issues have been resolved, in this latest incarnation anyway.
Did read about this in the 0.99 release notes, though you’d have to construct a JSON statement to make use of it, or is that your point, as a test point ?

This service call allows you to change zwave parameters. Which is what you were asking about, is it not?

We needed to be able to change them programmatically, so in the case of my siren, I could set the music to one tune when this event happens and another tune at a different volume should another happen. I think we have reached that (mine works anyway. Thanks for your interest and apologies if it diverted you.
There are a few threads I explored, when I get back I’ll ensure they all have a link back to the solution
Cheers
Mutt

Well, yeah, that’s what this service does. It allows you to change them. I’m confused as to how this isn’t a solution?

- service: zwave.set_config_parameter
  data_template:
    node_id: 1
    parameter: x
    value: "{{ blah }}"
    size: x
1 Like

Sorry, I’m away from home and only have access to a remote instance from a phone. Can’t copy and paste as “configuration” will not let me select text. I’ve tried installing Visual Studio Code, but it’s red on my add-ons and say “not available on your platform” (plain vanilla hassos 2.12 on raspberry pi 3 running hassio 0.99.2)
Your posted code will not work as the whole data_template needs encapsulating in curly brackets { }, size is not applicable as the html already defines the data sizes and does the translation from (say) “Fur Elise” to its relevant index.
I just can’t test the “{{ blah de blah}}” (yes I’ve watched hotel transelvania) from here so I’ll give it a go on my return (1 week)
Cheers
Mutt

You can’t use templates in the service calling section of the dev tools, this has never been possible. You can however create a script with the service and run the script.

And that’s what we have done.

This is only applicable in the service caller, and it’s not a template section. Also, yaml understands both:

- service: zwave.set_config_parameter
  data_template:
    node_id: 1
    parameter: x
    value: "{{ blah }}"
    size: x
- service: zwave.set_config_parameter
  data_template: {
    "node_id": 1,
    "parameter": "x",
    "value": "{{ blah }}",
    "size": "x",
}

So i’m not sure why you’re pointing that out.

Ha ha ha !,
Probably because of my ignorance of the distinction :rofl: