Skip to main content
1-Visitor
August 25, 2017
Solved

Making an estimation according to logged temperature property values

  • August 25, 2017
  • 2 replies
  • 2546 views

Hello everyone,

I'm trying to make an estimation about the duration of a cooling down process according to the measured temperature datas. I'm inteding to do this by writing a service to compare logged temperature values from the sensor and calculate the change of the temperature in a specific time intervall. I created a value stream and logged the temperature property, however I don't know how to retrieve the logged values with a custom service. I couldn't also find a tutorial about this. Can someone help me about this topic?

Thank you!

Best answer by emericboyu

I just created a subscription according to the DataChange of temperature. In that subscripton I substracted the old value of the data from the new value of the data and set that result as a property called tempDiff (me.tempDiff = eventData.oldValue.value-eventData.newValue.value;). According to this difference the estimated cool down time is calculated.

2 replies

20-Turquoise
August 25, 2017

You can retrieve property values through the Thing assigned to the value stream using a snippet QueryPropertyHistory (for example) against the time interval.  Returned result will be in an infotable format. Also, you may use a FOR function to loop through the values treating it as a table.

emericboyu1-VisitorAuthorAnswer
1-Visitor
August 29, 2017

I just created a subscription according to the DataChange of temperature. In that subscripton I substracted the old value of the data from the new value of the data and set that result as a property called tempDiff (me.tempDiff = eventData.oldValue.value-eventData.newValue.value;). According to this difference the estimated cool down time is calculated.