SmartThingsCommunity / st-device-sdk-c-ref

SmartThings SDK Reference for Direct Connected Devices for C
Apache License 2.0
119 stars 172 forks source link

Example esp8266 code for sending temperature data #65

Closed LucaSkywalkerZA closed 3 years ago

LucaSkywalkerZA commented 3 years ago

This guide was very helpful at getting a smart light working with an esp8266, however there aren't examples on sending data (eg temperature sensor) to Smartthings. In the light_example, there is functionality for a dummy dust sensor, however this makes use of header files such as caps_dustSensor.h and caps_dustSensor.c. Is there a place I could find premade temperatureMeasurement caps header files, or an example on how to do so? Thank you for your assistance

f34rdotcom commented 3 years ago

I use a few capabilities in my project maybe it will help. Still not well documented on some capabilities but most so far are simple. Also you can look from the results of the publish to the MQTT server in debugging if it was accepted and if not so far it has been a clear reply error from the server describing the issue.

https://github.com/nutechsoftware/AlarmDecoder-STSDK/tree/master/components/stsdk

LucaSkywalkerZA commented 3 years ago

Thanks for your help!

On Mon, 19 Oct 2020, 9:44 pm Sean Mathews, notifications@github.com wrote:

I use a few capabilities in my project maybe it will help. Still not well documented on some capabilities but most so far are simple. Also you can look from the results of the publish to the MQTT server in debugging if it was accepted and if not so far it has been a clear reply error from the server describing the issue.

https://github.com/nutechsoftware/AlarmDecoder-STSDK/tree/master/components/stsdk

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/SmartThingsCommunity/st-device-sdk-c-ref/issues/65#issuecomment-712401131, or unsubscribe https://github.com/notifications/unsubscribe-auth/AHL6N5RAPAM4WIUB4VW242DSLSJKZANCNFSM4SWNY64A .

Kwang-Hui commented 3 years ago

This guide was very helpful at getting a smart light working with an esp8266, however there aren't examples on sending data (eg temperature sensor) to Smartthings. In the light_example, there is functionality for a dummy dust sensor, however this makes use of header files such as caps_dustSensor.h and caps_dustSensor.c. Is there a place I could find premade temperatureMeasurement caps header files, or an example on how to do so? Thank you for your assistance

Hi @LucaSkywaIker , You can find most of standard capability handler files at https://github.com/SmartThingsCommunity/st-device-sdk-c-ref/tree/master/apps/capability_sample (caps_temperatureMeasurement.c would be good for your purpose)

I think this document also helpful - https://github.com/SmartThingsCommunity/st-device-sdk-c-ref/wiki/How-to-write-code-for-sending-device-event

Thanks.

LucaSkywalkerZA commented 3 years ago

This is exactly what I needed, thank you.