cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Need to share some code when posting a question or reply? Make sure to use the "Insert code sample" menu option. Learn more! X

How to get numeric value from thing property and set it on gauge

mett
6-Contributor

How to get numeric value from thing property and set it on gauge

What I've done:

- thing created

- in thing:

-- property created: temperature NUMBER

-- service created: getTemperature():

var result = me.temperature;

output NUMERIC

-- service created: increaseTemperature():

me.temperature++;

-- service created: decreaseTemperature():

me.temperature--;

- mashup created

- in mashup:

-- added gauge widget

-- added label

-- added button: "plus"

-- added button: "minus"

-- added entities: all 3 services from thing

-- connected button Plus click event with increaseTemperature()

-- connected button Minus click with decreaseTemperature()

-- connected gauge data with getTemperature()

-- connected label text with getTemperature()

 

Now I try to view my mashup

 

Buttons Plus and Minus work well. I see in the model that my value changes correctly.

 

But Gauge and Label don't work. Gauge doesn't show Arrow.

Label doesn't show value.

 

What I'm doing wrong?

 

I've make even a third button "refresh", and I've connected the click event with getTemperature(), and then the output I've connected to my gauge and label, but still it doesn't work.

1 ACCEPTED SOLUTION

Accepted Solutions
mett
6-Contributor
(To:mett)

Fix:

 

- Make sure getTemperature() is not dynamic entity

- Use All Data instead of Selected Row

View solution in original post

1 REPLY 1
mett
6-Contributor
(To:mett)

Fix:

 

- Make sure getTemperature() is not dynamic entity

- Use All Data instead of Selected Row

Top Tags