BIM ioT - Printable Version +- Logic Machine Forum (https://forum.logicmachine.net) +-- Forum: LogicMachine eco-system (https://forum.logicmachine.net/forumdisplay.php?fid=1) +--- Forum: Gateway (https://forum.logicmachine.net/forumdisplay.php?fid=10) +--- Thread: BIM ioT (/showthread.php?tid=3347) Pages:
1
2
|
BIM ioT - gdimaria - 06.05.2021 Hi, I have to connect LM to Bim ioT ACCA Software. Communication takes place via JSON strings such as the following: READING MESSAGE: { "payload":{ "Type": "Item":{ "Name": "State": "Type": "Editable": "Link": }, "TimeStamp": }, } WRITING MESSAGE { “Action”: “Controller”: “ItemName”: “ItemState”: } Hon can arrange that with LM? Thank you so much Peppe RE: BIM ioT - admin - 06.05.2021 JSON is just a data format but what is used as a transport, HTTP or something else? RE: BIM ioT - gdimaria - 06.05.2021 from the notes provided: "The connection to usBIM.IoT takes place via certified Web Sockets. The certificate is provided by Acca and the flow of incoming and outgoing data is regularized by the formalism shown below " RE: BIM ioT - gdimaria - 07.05.2021 (06.05.2021, 15:08)admin Wrote: JSON is just a data format but what is used as a transport, HTTP or something else? I thought of translating the notes provided by our client to better understand the problem. I hope you can help me. Peppe P.S. This BIM standard, as you certainly know, is expanding a lot and will soon become, at least in Italy, mandatory for any building project. So I think it is important to understand how to interface LM. RE: BIM ioT - admin - 07.05.2021 You can use this library to create a websocket client script on LM: https://forum.logicmachine.net/showthread.php?tid=1294&pid=7823#pid7823 RE: BIM ioT - gdimaria - 10.05.2021 (07.05.2021, 07:59)admin Wrote: You can use this library to create a websocket client script on LM: https://forum.logicmachine.net/showthread.php?tid=1294&pid=7823#pid7823 they send me the attached certificate keys (temporary) for the ws connections.... Can you explain me how I could use them on LM? the address of the server to connect is wss://test-hub.usbim.com RE: BIM ioT - admin - 11.05.2021 1. Install 2021 RC1 firmware. 2. Create a user library named websocket using the attached source.
3. Upload certificates via FTP using ftp login, rename files with long names to cert.pem and key.pem accordingly.4. Create a resident script with 0 sleep time. Code: if not client then This example is only a starting point, it should be extended with additional send/receive logic. RE: BIM ioT - gdimaria - 11.05.2021 (11.05.2021, 07:08)admin Wrote: 1. Install 2021 RC1 firmware. Thank you very much.... now I am getting that log.... I guess something is still wrong... RE: BIM ioT - admin - 11.05.2021 This means that the script is connected but there are no messages to be read from the websocket connection. Can you describe what data do you want to send/receive via this connection? RE: BIM ioT - gdimaria - 11.05.2021 Sure, I already send you a pdf with the notes, by the way, they are JSON strings like the following: READ MESSAGGE { "payload": { "Type": "NotificationPackage" "Item": { "Name": "Temperatura-SudOvest" "State": “28.5” "Type": “NUMBER:FLOAT” "Editable": 0, "Link": "" }, "TimeStamp": “2020-09-22T15:27:59.140Z” } } WRITE MESSAGE { “Action”:“Post” “Controller”:“Items” “ItemName”:“Light-Box” “ItemState”: “OFF” } TO REQUEST THE STATE OF A LAMP { “Action”:“GET” “Controller”:“Items” “ItemName”: “Light-Box” } TO REQUEST THE LIST OF OBJECTS { “Action”:“GET” “Controller”: “Items” } RE: BIM ioT - admin - 11.05.2021 I know about the protocol but the question was about your own use case. What kind of devices are going to control like this? Or do you want to read some sensor values? RE: BIM ioT - gdimaria - 11.05.2021 (11.05.2021, 09:42)admin Wrote: I know about the protocol but the question was about your own use case. What kind of devices are going to control like this? Or do you want to read some sensor values? I have to let them to control the ETS objects in LM... so I have to send sensor values, object states and let them to command i.e. lamps, termostate setpoint, etc. RE: BIM ioT - admin - 13.05.2021 1. Create a user library named bim-iot using the attached source. 2. Make sure that the updated websocket library and keys are in place. 3. Create a resident script with sleep time = 0: Code: if not wsclient then RE: BIM ioT - gdimaria - 13.05.2021 The connection is ok, but they still can't get nothing. I guess you already understood, but just to be clear: they should receive any object event when it occurs and to be able to write on the objects. Can I send you the backup of my LM in private? Could be useful? Thanks Peppe RE: BIM ioT - admin - 13.05.2021 The script is sending the object values when the connection is established. Do you have any tool to read/write data from the IoT gateway side? RE: BIM ioT - gdimaria - 13.05.2021 they checked the logs and the data they are receiving but it seems to be not in the correct format due to an error that is present in the documentation we sent you. We receive the following JSON: { "payload": { "Type": "NotificationPackage", "Item": { "Link": "", "State": "Thu 13-05-2021", "Type": "STRING", "Name": "daymonthyear", "Editable": 2 }, "TimeStamp": "2021-05-13T09: 00: 01.288Z" } } But the correct format is: { "Type": "NotificationPackage", "Item": { "Link": "", "State": "Thu 13-05-2021", "Type": "STRING", "Name": "daymonthyear", "Editable": 2 }, "TimeStamp": "2021-05-13T09: 00: 01.288Z" } In practice, the payload node is not necessary. RE: BIM ioT - admin - 13.05.2021 Modify the sendobjvalue function in bim-iot library and do a full script restart via disable/enable: Code: function sendobjvalue(obj) RE: BIM ioT - gdimaria - 13.05.2021 (13.05.2021, 09:53)admin Wrote: Modify the sendobjvalue function in bim-iot library and do a full script restart via disable/enable: I already done it... Everything seems to works fine at moment... now they said me that they will try to send write messages in the next days... hopefully everything will be fine. Thank you so much for your priceless support! Peppe RE: BIM ioT - gdimaria - 28.05.2021 (13.05.2021, 09:53)admin Wrote: Modify the sendobjvalue function in bim-iot library and do a full script restart via disable/enable: HI, They finally tested the ws connection sending commands from their side: it doesn't work. They try to on/off a led or to set temperature on a termostate, but nothing happens. They json strings they are sending are like: { “Action”:“Post” “Controller”:“Items” “ItemName”:“Led 1” “ItemState”:“ON” } or { “Action”:“Post” “Controller”:“Items” “ItemName”:“Temperatura” “ItemState”:“22.0” } But no success. Another problem is that they are receiving the status of ALL objects, ALL in read / write mode. instead we must be able to choose which objects to transmit and specify whether to read or write or both. I am grateful for your help. BR Peppe RE: BIM ioT - admin - 28.05.2021 Use the attached updated library and see if receiving values works. You must tag the objects that you want to be accessible via this connection. Use either bim-read, bim-write or bim-read-write tag to define the access level. Only one tag can be used for any object. |