@urman I am in the process of building a custom device type for an Arduino Thing Shield. I have the Arduino monitoring 6 doors via magnetic contact sensors and 1 DS18B20 temperature sensor. Currently, the Arduino code sends a unique command for any change in state of a door contact sensor using a command similar to:
Likewise, it can send a new temperature reading periodically as well. Everything is working fairly well, however I am eager to add more capabilities to the Arduino - possibly a motion detector, humidity sensor, … (you get the idea!)
In order to keep the state of all of the sensors up to date and in synch between the ST Cloud and the Arduino, I periodically issue 7 smartthing.send ("… …") commands (one for each of the 7 attributes.) This results in my device type’s parse function being executed 7 times. This process is somewhat slow, causing the Arduino to be tied up for about 7 seconds while sending the zigbee data.
Is it possible to send all of the data up to the ST Cloud at one time? Hopefully this would speed up the data transfer process significantly.
- Is there a maximum size limit to the string sent in the smartthing.send ("… …") command?
- What would the parse function look like if all 7 (or more) attributes were sent at one time?
Any help (or similar examples) would be greatly appreciated as I become more proficient in the ST Groovy Language. I have seen some forum post refer to returning an array of results at the end of the parse function, but I am unclear if/how this would work.