How to store temp in virtual device

I have created a virtual device of type Virtual Temperature. I want to take the temperature value out of a thermostat and store in this device every time the temperature changes. I cannot for the life of me figure out how to do that in the Rule Machine? Any help would be appreciated. Thanks.

Run custom action. Here is the opposite direction, but it should work.

1 Like

@napalmcsr

That's on the money. But more important (to me) are these tabs:

08%20PM

Is that a steamed treacle pudding you're making? Haven't tucked into one of those since my days as a school boy. When can I come over?

2 Likes

How about some Spotted D**k pudding?

What do I do now? Thanks.

Select string
And
Put in %value%
Value is the value from the trigger

And yes I am thinking of trying to make a traecle pudding or a sticky toffee pudding... My life can't be all about home automation! :slight_smile:

3 Likes

I've never made either. I grew up having them in cans - boiled on the stove top. Would love to know how it goes.

I don't seem to be able to get this to work. Any thoughts?

Here is my rule and I do see the temp updating in the events.


What type of virtual sensor are you using?

there is a ", " before %value% in your settemperature...

I do indeed have a ", " before. I apparently had two parameters. I tried to delete the other parameter but there doesn't appear to be a way to do this so I removed and re-added everything. Let's see how it goes. Thanks.

Still no good. No updates to the virtual device.

To answer a previous question the device is setup as a Virtual Temperature Sensor. My updated rule is below. Also, one weird thing, the virtual device is showing it is in use by two rules and yet in my rule machine there is only one? Is this normal? Thanks.

Can you turn on action logging and get logs?

This is interesting - just noticed this in the log:

app:101. 2019-10-20 01:49:09.070 pm [error] java.lang.NumberFormatException: For input string: "74.7" on line 5428 (allHandler)

dev:98 2019-10-20 01:49:08.801 pm Master Bathroom Floor temperature is 74.7°F.

Looks like the rule is firing but failing. I went back through the steps and in the run custom action, then Temperature, then Set Temperature I picked Decimal instead but then I got the following error:

java.lang.NumberFormatException: null on line 5424 (appButtonHandler)

So it clearly doesn't like what I am doing. As mentioned I selected Virtual Temperature Sensor. Clearly it doesn't like have values assigned to it? Is there a generic numeric virtual device type I could use to store the value? Thanks.

Try a virtual motion sensor. That worked when I tried it.

What do you know - that worked! Thanks.

What type of parameter did you assign when you were trying to use the setTemperature Command? I just tried this with a virtual temp sensor and using either number or decimal worked perfectly when the number was an integer. If your number is a decimal, you have to pick decimal. Otherwise, I doubt it will work right.

image

This worked perfectly first time.

After setting it to virtual motion sensor and it worked. Then I switched type back to virtual temperature sensor and it still worked. Go figure.

2 Likes

Download the Hubitat app