Writing an Attribute Value to a Local File (Variable) in RM4 (or directly within Driver Code)

I would like to write the contents of a device attribute to a local file on the Hubitat hub. When I try to select this option in RM4 I do not see any devices presented for me to select. Is this expected? Or am I doing something wrong? To do this I am selecting the "Set a variable" option, where the variable represents the local file.

Simon

For anyone else who needs this, I was able to get around this by first setting another local variable to the value of the attribute, then referencing that local variable when updating the variable representing the local file.

1 Like

For any developers looking for a simpler / neater solution without the need for RM rules and variables,
Hubigraphs was already doing this, and more recently @thebearmay has provided an updated copy of the code that can be introduced into other drivers.

2 Likes