Smartthings hub is not invoke parse() method on post request

Hi,

Prior to post this query i have gone through most of the post and try most of the solution.

I tried to push a command from post request which should go to hub and hub should call parse() method.
I have put deviceid as MAC address.
IP address and port number in hex.

Device handle : https://github.com/stjohnjohnson/smartthings-mqtt-bridge/blob/master/devicetypes/stj/mqtt-bridge.src/mqtt-bridge.groovy
App: https://github.com/stjohnjohnson/smartthings-mqtt-bridge/blob/master/smartapps/stj/mqtt-bridge.src/mqtt-bridge.groovy

I am getting the device notification for subscribe call on listening configured server but when i do post request with curl/postman.
curl -H “Content-Type : application/json” -X POST -d ‘{“name”:“GE Plug-In Switch”,“value”:“off”,“type”:“switch”}’ http://192.168.50.2:39500

Attached the device info.

Please correct me if i am doing wrong some where.

Thanks
Jiten

Your device handler is MQTT Bridge. This isn’t an MQTT messages. So, why do you think it would respond? Plus, you can’t issue commands from one device to another. What you’re looking for is a SmartApp. You can’t control SmarThings that way.

Hi Ryan,

Sorry for name confusion.
I had inherited same names from given example links.
Device type selected as MQTT Bridge. Please suggest, what device type i need to select from drop down.

I just want to send REST request to hub and control the device as mentioned in the
http://docs.smartthings.com/en/latest/cloud-and-lan-connected-device-types-developers-guide/building-lan-connected-device-types/building-the-device-type.html

Can you please help me out what wrong things i am doing.

Thanks

#1 that info is for building a Lan connected device, like a light bulb or switch. #2 What you are trying to do is control other devices. You cannot do that from a device. Only a smartapp can do that. Devices cannot issue commands to other devices. Look at the info about building a smartapp. But I ask… Why are you doing this? There are already other ways to accomplish what you are trying to do much easier. Take a look at WebCore.

Hi Ryan,

Please correct me if i am going wrong somewhere.

Let me explain you what i want to implement.

  1. I want to control Smartthings devices from my linux machine(it could be desktop/ raspberry pi)
  2. To achieve this, i tried with https://www.home-assistant.io/. For Smartthing V2, i can listen for changes but can’t make status change of the devices.
  3. I found issue with home-assistant, it is combination of many technologies.
  4. I want to implement everything into single service. I wrote subscriber listener in the C and now i want to run some action from my linux box to smartthings which can further propagate to end device.
  5. I have gone through portals, blog, community. Some places it is mention, it is possible while some places suggested to go web-service.

Let me know above things are feasible or not.

Mean time, i am going through the webCore.

Thanks,
Jiten

Hi,

I got the solution from https://github.com/Welasco/NodeFirePlace

Thank you for suggestions.

No, it is not.