I am just starting out with IBM Watson IoT Platform. I am trying to figure out where I should solve my problem. Keep in mind, I can not change the remote device itself.
Background:
A third party sensor we are using sends us data as multiple JSON string in separate HTTP posts. I am forwarding data via the HTTP API
curl -v -X POST -H "Content-Type: application/json" -u "use-token-auth:passw0rd" -d @message.txt https://myOrgID.messaging.internetofthings.ibmcloud.com:8883/api/v0002/device/types/TestDevices/devices/TestPublishEvent/events/TestMessage
e.g. The device has multiple sensors and sends one HTTP message for each reading.
Message.txt could be:
{
"device": "device001",
"timestamp": "2018-05-18T11:16:00.000+0000",
"sensor": "Temp",
"value": "32.2",
"unit": "C"
}
Message.txt could also be:
{
"device": "device001",
"timestamp": "2018-05-18T11:16:00.000+0000",
"sensor": "Particles",
"value": "200",
"unit": "P_4.00_UM"
}
There a x amount of sensors which can have y types of units. e.g. Celsius and Fahrenheit for temp readings. And Particles come a dozen sizes. For now there is one device.
Currently I push data into the platform, but I can not figure out how to handle multiple sensors readings coming in over a single endpoint one reading for each message. I do not know where I am supposed to put the logic.
- I could write an IBM Cloud Function that sends data to specific "Topics" depending on the data- based on a filter.
- Or perhaps map this out in node-red by having a HTTPS listener there.
- I am thinking WIOTP can be configured to handle my case and I am missing something essential.
I am looking for a pointer on how to proceed, thank you.