Copying temperature from sensor to Virtual Thermostat - Works in Legacy, not 5.1

I am working on porting my legacy rules to 5.1. one of them is a rule where I copy temperature from a temp sensor and paste it on a Virtual Thermostat as setTemperature. Reason for this is to be able to query Google Home about the Outside temperature.

This works well in Legacy, but not in 5.1. In Legacy I get the temperature value, but not in 5.1. While playing around I at one point got %value% to display, but then it "dissapeared"?

Any idea if I am doing something incorrectly or if this is a bug?

Here is a comparison screenshot:

I don't see anything wrong from your screenshots--you just need to add a decimal (or number if you prefer) parameter to your custom command, then feed it the new value somehow. In your Legacy rule, it's possible you have a local variable called value that you assigned the value of some device attribute. If your (only) trigger event is the "real" device temperture, you could also just type %value% as the value for the parameter here, which will represent the value of the last trigger event (it's possible this is how RM Legacy displays this and you didn't manually create a different variable, though I don't recall).

1 Like

It wont necessarily show up in the rule .but should be ok when it fires. Have you actually tested it that way.

This rule will not work unless a parameter is added to the setTemperature() command, with one way being either described above.

Indeed, I knew I needed %value% in there, but I did not have the parameter in the rule. Turns out it will only show up when the temperature changes in the original Temp sensor. Once it did, I then saw the %value% and could use that.

It seems to work now. Thank you for the support and suggestions. I was just flummoxed as it did not appear in the same manner as the old Legacy rule.

EDIT: I spoke too soon. Now the parameter is gone and the return value is zero.

This is how it looked after waiting for the change:

image

And initially the rule also looked fine, with the temperature shown, but now it is simply Zero and the parameter is gone.

Sorry if i'm going slightly off topic but could the OP also use Device Mirror in the Mirror App?

I'm guessing you hit "Run Actions." The built-in value variable refers to the value of the last trigger event. When the actions are run manually, there is none. It will work fine when your rule actually triggers. It is set up correctly now, afs ar as I can see from your screenshot.

No, that was designed for lights/switches or (with a different child app) locks. I don't see the ability for it to do this kind of thing.

Yup, confirmed. It works once the rule is running, at least it has been working today. It is just a bit unusual not to be able to see a "result" while it is being configured, as well as seeing the variable disappear from the list once it was "used".

Everything is now back in the rule and looks like it should.

Thanks again for the assistance.

1 Like

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.