Custom command with multiple fields?

Hi, all! I want to make a rule machine rule (or button controller action, same difference) to run this command of my Ecobee thermostat:

I want to set the "Program name" to "Nap" and the "Hold Type" to "nextTransition" (which is one of the enum options). Submitting one but not the other wouldn't meet my needs.

I tried doing this in Rule Machine using custom actions, and I got this far:

And now I'm stuck. How do I send both fields? How do I set the key and value for each field? I can add multiple "parameters", but each is just a value, not a key/value pair.

Thank you!

1 Like

Finish creating the parameter you're adding now, which wound correspond to Program Name, by setting its value to "Nap". Then, add a second parameter in a similar way (type should also be string) except provide "nextTransition" as the value.

Command parameters are ultimately not named (though drivers can provide data to show names and other metadata in order to make things more friendly). They are just positional like typical Java method parameters -- in case you expecting other behavior -- so, more or less, what you're doing should work if you just keep going.

Before you do that, also check that you selected the right command. It sounds like you want setThermostatProgram, but your rule screenshot shows that you selected setThermostatMode.

4 Likes

Thank you, this worked! (Also yeah, this was me trying to reproduce the issue for a screenshot and getting the name wrong; I fixed it in post.)