No way to set a device attribute through a rule?

is there no way to do this other than first setting it in a variable and then setting.. seems like a new option is needed.

use case
have two attributes changing in one device and via a "changed" trigger want to set a corresponding attribute in a different device based on the %value% in the trigger , seems counter inuitivfe that i first have to push it to a variable and then run a custom action..

seems like a new action set attribute name %value% would be very usefull thanks

Variables were introduced for exactly this sort of purpose. Extending RM with more 'features' when you can already do something does not make the list.

1 Like

ok just a pain to create variables and then have two extra steps in the rule that uses them.. just to copy an attribute or two.

Sorry, but RM is too big and too complex. Adding more features to save two steps doesn't make the cut. What you're talking about sounds like it would be a great candidate for a small custom app.

i guess it was a misunderstanding it actually works if you call a custom fx and first fill in the %value% for the parameter value .. then turn on use variable.. the %value% in the trigger is passed through to the custom fx. Is this not by design.. unfortun. if you want to pass two values in an or trigger you need to break it up to two separate rules. no need to create an intermediate variable which is what i was trying to avoid.

something like this works fine..

now if i could only the the api working ot get the latitude and longitude correctly out as it is uspposedly document.

But you are right there is no way to set an attribute in a device through rule machine that i can find.. you need to have control over the device code and code up custom commands

That is what i thought was missing in rule machine as we dont always have control over the code base and it would be nice to be able to set a custom attribute in a device .

Attributes are set by events. The driver code internally sets an attribute with sendEvent(). That could be in response to parse() or a device command. In the case of an attribute that is set by a command, RM can issue the command. RM does not have a sendEvent mechanism.

Download the Hubitat app