Setting Variable from Device Status

I am trying to pull a device attribute and set it as a variable. Currently, I have a remainingtime device attribute being displayed on a dashboard. My goal is to convert the total minutes into hours and minutes. I have found a post by Sebastien to accomplish this task and it works. The issue is grabbing the remainingtime from the device.

I have setup a Hub Global Variable (tried local variable also). When creating a New Action in Rule Maker, the 'select attribute' isn't showing any of the attributes for my device. I know the attributes are there since I use it in a dashboard.

I read that this maybe available by another method but I can't find it. Any help is appreciatied.

The attributes for the device will be shown that match the variable type. For example, if the variable is a string then device attributes like motion (active/inactive) will be shown and not numbers.

Here are some examples for the same device

1 Like

That is the issue. Created new variables to test and the variable is a string.

My solution:
I went into the device driver and changed the device attribute from 'string' to 'number'. Then I was able to pull the 'remainingTime' from the device and have a rule convert the number of minutes to hours, minutes.

Thank you for your help.

1 Like