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

SAP Leonardo - computing and updating measures

former_member655843
Discoverer
0 Likes
518

Hi,

We've come across a situation where we need to do some postprocessing of Thing data in SAP Leonardo. Preferably in such a manner that the modified values are stored in the thing measures themselves (that is, the client applications should be able to read the modified values using the SAP Leonardo APIs). There are two scenarios we need to address.

1. A sensor is providing us with temperature measurements in the Fahrenheit scale. We need to provide the data to the cloud apps in degrees of Celsius. We do not have the option of reconfiguring the device and would like to avoid using additional software (e.g. using a custom edge with an interceptor to transform the data before ingestion) - the data is sent directly to the cloud gateway. What are our options? Does Leonardo IoT offer any means to compute "derived" values?

2. The device is in one of four states (busy, maintenance, stopped, idle) at any given time. The device informs us only on state changes by sending the new state. Upon receiving a state update from the device we'd like to "close" the previous state and determine its duration. For example, the device signaled going into busy state at 11.00. At 11.15 the device goes into the idle state - upon receiving the update we'd need to note that the device was in state "busy" for the duartion of 15 minutes. Preferably we'd achieve this by updating the previous measurement with its duration. Can such computations and updates be done within Leonardo IoT?

Thank you,

Accepted Solutions (1)

Accepted Solutions (1)

fvviviani
Participant
0 Likes

Hi Miha,

Given your constraints, maybe the best option would be to use a microservice to do such transformations, and push data for the new measure using Leonardo IoT APIs. You could, for example, trigger the call to the microservice by using a Leonardo IoT Rule. Alternatively, you could poll the measure in Fahrenheit from the microservice. The Thing is, that you should alter the data model at a minimum extent, i.e., add a variable for Celsius storage.

Hope that was clear,

BR,

Federico

former_member655843
Discoverer
0 Likes

Federico, thank you for the idea, we will attempt updating the measurements via the microservices.

Thanks again,

Miha

Answers (1)

Answers (1)

fvviviani
Participant
0 Likes

Hello,

I don't think that you can do what you describe leveraging Leonardo IoT only.

Do you have other modules in the SAP IoT stack (e.g., SAP IoT Services, SAP Edge Services...)?

Do you have the possibility to create custom microservices?

BR,

Federico

former_member655843
Discoverer
0 Likes

Hi Federico,

Thank you for your answer. We do have SAP IoT Services and SAP Edge Gateway (but not SAP Edge Services) at our disposal. We also can create our own apps in the cloud foundry environment, giving us the ability to create custom microservices.

BR