Appending to file, how to select device info to write?

C7 hub

I am writing a rule that runs every 15 minutes to log a bunch of temperature sensors to a bunch of files.

Currently I have a local variable called a_temperature that I use to fill with a temperature device, then in second step, I append to a file that variable.
This requires 2 actions per log file.

Here is an example in Actions:

Set A_Temperature to Thermostat Dn Bed SW (Stelpro) Temperature(74.0)
Append to Temperature_Log_Dn_Bed_SW.text: '%date% %time%; Temperature=%A_Temperature%'

I have looked, but cannot seem to find a way to combine these 2 actions into one.

Ideally, I'd like something like:

Append to Temperature_Log_Dn_Bed_SW.text: '%date% %time%; Temperature=%Thermostat Dn Bed SW (Stelpro) Temperature%'

Am I missing something?

Thanks.

I think your Append command shoul use this variable string:

`date% %time%; Temperature=%A_Temperature%'

S

You can't reference a device attribute directly using variable interpolation (%var%), if that is what you are asking.

Hi hubitrep:

I'm not totally clear on the nomenclature here. I'm a little confused on your reference to 'variable interpolation (%var%)',

The object is to eliminate the intermediate variable 'A_Temperature'.

Also to do the whole 'read the device temperature' and 'write that value to a file' in one action.

I think I am hearing I cannot do that.

Ideally, I'd like to format a single action that might look like the following...

Append to Temperature_Log_Dn_Bed_SW.text: '%date% %time%; Temperature=Thermostat Dn Bed SW (Stelpro) Temperature

or more briefly...
Append to filename: 'Thermostat Temperature'

Thanks, Mark.

It’s my understanding that, in general, no, you can’t.

The exception is for the device attribute which triggered the rule (or, I think, successful completion of a wait), its value is available directly as %value%