sending data to thingsboard.io - 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: sending data to thingsboard.io (/showthread.php?tid=5106) |
sending data to thingsboard.io - gdimaria - 22.11.2023 hi, I would use the platform Thingsboard.io to send and collect value data from LM objects. they allows to do it by 2 ways: HTTP request ( es. curl -v -X POST http://demo.thingsboard.io/api/v1/eoKkkZ6JL7UbmyOHGX9L/telemetry --header Content-Type:application/json --data "{temperature:25}") or MQTT (es. curl -v -X POST http://demo.thingsboard.io/api/v1/eoKkkZ6JL7UbmyOHGX9L/telemetry --header Content-Type:application/json --data "{temperature:25}") how could I implement everything on LM? Thanks in advance Peppe RE: sending data to thingsboard.io - admin - 22.11.2023 For HTTP use this: Code: require('json') For MQTT search the forum, there are many examples of how to use it. The data must be encoded using JSON, same as for HTTP requests. RE: sending data to thingsboard.io - gdimaria - 22.11.2023 (22.11.2023, 11:12)admin Wrote: For HTTP use this: Thank you. How to pass a object value? Code: value = grp.getvalue('4/1/11') That way doesn't work. What is correct syntax? RE: sending data to thingsboard.io - admin - 22.11.2023 The syntax is correct, for event scripts use event.getvalue() instead of grp.getvalue(). What kind of error are you getting? RE: sending data to thingsboard.io - gdimaria - 22.11.2023 (22.11.2023, 13:38)admin Wrote: The syntax is correct, for event scripts use event.getvalue() instead of grp.getvalue(). No errors, sorry. It's all right now. Thanks Peppe RE: sending data to thingsboard.io - gdimaria - 27.11.2023 (22.11.2023, 11:12)admin Wrote: For HTTP use this: I am trying to provision an object in mqtt. Thingsboard says me to execute the command: Code: mosquitto_pub -d -q 1 -h demo.thingsboard.io -p 1883 -t v1/devices/me/telemetry -u "gximaxia" -P "12345678" -m "{temperature:25}" I need send data of dozen of knx objects, how I can do it without give different username and password? What is the short/best way to do it? Thanks Peppe RE: sending data to thingsboard.io - admin - 27.11.2023 See this example: https://kb.logicmachine.net/integration/mqtt-client/ RE: sending data to thingsboard.io - gdimaria - 15.05.2024 Hi, I would like to implement the so-called Thingsboard.io Server-side RPC (https://thingsboard.io/docs/pe/user-guide/rpc/) to send simple commands to KNX objects (e.g. on/off, set temperature, etc.). is it possible? How I can do? Thanks in advance Peppe RE: sending data to thingsboard.io - Daniel - 15.05.2024 They support MQTT so you should be good to go. You will need a broker somewhere, if it is locally then you can use LM broker app. RE: sending data to thingsboard.io - gdimaria - 24.05.2024 (15.05.2024, 10:03)Daniel Wrote: They support MQTT so you should be good to go. You will need a broker somewhere, if it is locally then you can use LM broker app. What do you mean for "locally"? Thingsboard is on a VM in the cloud... is LM Broker app ok for this? Can you give me please some basic advice how to use it? RE: sending data to thingsboard.io - Daniel - 24.05.2024 If it is in the cloud then you need broker in the cloud. Our broker app wont work. RE: sending data to thingsboard.io - gdimaria - 08.07.2024 (15.05.2024, 10:03)Daniel Wrote: They support MQTT so you should be good to go. You will need a broker somewhere, if it is locally then you can use LM broker app. If I put LM and Thingsboard VM under the same Zerotier network, can I use LM MQTT Broker app? In that case, how I can let TB to send write commands to LM? Right now I only use a script to send values to TB: Code: indirizzo = event.dst How should be to receive commands? Thanks a lot! Peppe RE: sending data to thingsboard.io - Daniel - 08.07.2024 It should work. See here for LM MQTT client script. https://kb.logicmachine.net/integration/mqtt-client/ There are many more examples on the forum. |