How can I receive LAN messages on the ST hub (when the messages can come at any point)?

yea… finally got a JSON response specific to the sensor attached by task number. (/json?tasknr=1) found the reference in the ESP Easy board. (Their webpage is a mess) Thanks though.

I am implementing the example above and have a few questions as I cannot get all of it to work. My code on my PI is sending plain text messages but I also tried this with the Curl json commands above. Before I added the device in ST, I ran a test and I see the following message in Live Logging so I know that my PI is sending the message to the hub from both my code and the Curl json commands. It just shows up as a hubEvent.

11:38:20 PM: debug hubEvent: [index:05, mac:B827EBmymac]

Then, I added the device and ran the tests again and Live Logging shows nothing but the device updates the Last Activity in the device dashboard every time I send a message. I did not implement the device handler, I was expecting to see the messages in the logs but I do not see the messages on my RPI device on my phone or in any of the logs in the dashboards that show the message contents.

Display Name: RPI3
Type: placeholder
Location: Home
Hub: Home Hub
Zigbee Id
Device Network Id: B827EBmymac
Status: ACTIVE
Execution Location: Cloud
Last Activity: 23 minutes ago

My question is, and yes, I am new to ST, I implemented my RPI device as type placeholder from the drop down, does the type affect the device capabilities? Second, do I need to implement the device handler?, I do not think so, I should be seeing messages in the logs? I do not see the message contents on the device. Thanks in advance.

But you do see the events in the logs. If you only get them when you haven’t added a device instance of a device handler then I expect your handler either is not printing them correctly to logs (in the parse function), or you haven’t got the DeviceID correct on the Device.

If you are using the MAC as the DeviceID then beware that you probably need to enable mDNS/SSDP on the raspberry pi (this is what smartthings uses to convert MAC to IP). (I list both features add I couldn’t remember which one ST uses, but adding both is certainly useful). If you want to test without MAC conversion problems then you should change the DeviceID to be IP:port where they are both listed in hex and in capital letters with only the single colon between them. E.g. C0A80004:0050 for 192.168.0.4 on port 80

Thanks, I am suspecting that it is my handler. I changed the device to Philips Hue just as a test, and I see the logs. I need to read more documentation …

Feel free to post (with code tags - pre-formatted text) if you want a quick hint or two.

A quick FYI for anyone trying this out from Windows - it seems you need to escape the quotes, so the correct Curl would be:

curl -H “Content-Type: application/json” -X POST -d “{\“message\”:\“This is a test\”}” http://x.x.x.x:39500

© 2019 SmartThings, Inc. All Rights Reserved. Terms of Use | Privacy Policy

SmartThings; SmartApps®; Physical Graph; Hello, Home; and Hello, Smart Home are all trademarks of the SmartThings, Inc.