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

Making an estimation according to logged temperature property values

emericboyu
1-Newbie

Making an estimation according to logged temperature property values

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!

ACCEPTED SOLUTION

Accepted Solutions

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.

View solution in original post

2 REPLIES 2
posipova
20-Turquoise
(To:emericboyu)

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.

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.

Announcements


Top Tags