Logic Machine Forum
LM and Cumulocity IOT integration - Printable Version

+- Logic Machine Forum (https://forum.logicmachine.net)
+-- Forum: LogicMachine eco-system (https://forum.logicmachine.net/forumdisplay.php?fid=1)
+--- Forum: Scripting (https://forum.logicmachine.net/forumdisplay.php?fid=8)
+--- Thread: LM and Cumulocity IOT integration (/showthread.php?tid=5591)



LM and Cumulocity IOT integration - fleeceable - 02.09.2024

Hello!

Does anyone have integrated LM with Cumulocity IoT?
I need to send some parameters once in hour from LM to Cumulocity.

Things what I need to send:
  • 1h solar production
  • 1h solar production in eur
  • 1h solar usage
  • 1h solar usage in eur
  • 1h solar sell to grid
  • 1h solar sell to grid in eur

All of these are already prepared/calculated in LM side (hourly electrical price and calculations).

Also some alarms in case if there is connection error with solar inverter.

Can anyone help with authorization and example about sending some measurement data?
Cumulocity IoT - OpenAPI Specification

I think measurements are right way to go...

Cumulocity IoT's domain model - Cumulocity IoT documentation
Cumulocity IoT - OpenAPI Specification


Any help is appreciated!
Thanks!


RE: LM and Cumulocity IOT integration - admin - 02.09.2024

Auth header can be added like this:
Code:
require('encdec')
auth = 't0071234/testuser:secret123'

headers = {
  Authorization = 'Basic ' .. encdec.base64enc(auth),
}

Sending measurements is done by POST'ing JSON via HTTPS. There are many similar examples in the forum.
https://cumulocity.com/docs/concepts/domain-model/#measurements
https://cumulocity.com/api/core/#tag/Measurements