I have a platform with some devices that can measure some parameters like temperature, voltage, water flow, etc. I use REST API to get the values. For example, if I want to read temperature of device, I send this request:
GET https://MyIP/rest/Device/ID/temperature/
and I receive this response
{
"temperature": "25"
}
I would like to make a system based on rules and conditions, which can dynamically add and remove, using logic functions such as AND, OR, LESS_THAN, GREATER_THAN, etc.
The idea I have would be, for example, this rules:
- Every 5 sec, get temperature of device A and IF is greater than 50 return 1, else return 0.
- Every 10 sec, get temperature of device B and IF is greater than 50 during 1 hour return 1, else return 0.
- Every 5 min, IF voltage of Device A is less than voltage of Device B OR voltage of sensor C is greater than 260 return 1, else return 0.
All of this would be configured using REST.
My question: Is there any library that allows to do this (or similar) to avoid programming from scratch?