Is your device handler also using Hubaction to get JSON output from local LAN? If so can you post the device handler?
I just remembered that I ran into a weird situation once where something in my code was causing the method to fail, but it didnāt log the error or any of my debug messages.
I doubt thatās the problem, but just in case, you might want to try commenting out everything in the parse method except something like log.debug āparsedā.
Same thing doesnāt work. Thanks.
Not an expert at this at all, but shouldnāt he use theā¦
sendHubCommand(hubAction)
def refresh() {
log.debug "Executing 'refresh'"
def hubAction = new physicalgraph.device.HubAction(
method: "GET",
path: "/api/username/lights/1922029999",
headers: [HOST: "192.168.8.3:80", Accept: "application/json"])
log.debug hubAction
sendHubCommand(hubAction)
}
Can you try the fully qualified http with that.
I am not a hub action expert I have only parsed external calls.
Did you try it?
I tried commenting out everything except log.debug āparsedā nothing was logged still. I donāt think the code in parse() is the issue as I moved the code to refresh() and hardcodded the JSON to def result = slurper.parseText() and the state were working based on the output. Thanks.
yes I tried it, doesnāt work as well.
Itās on GitHub and it uses HubAction to communicate with a local device, but I just realized that Iām sending messages to it, but I donāt receive a response.
Iām not sure if you can get a response back from the device without implementing a service manager, but I might be interpreting the documentation wrongā¦
"When using a LAN connected device, the service manager is used to
discover and initiate a connection between the device and your hub,
using the protocols SSDP or mDNS/DNS-SD. Then the device-handler uses
UPnP/SOAP Calls or REST Calls to communicate outgoing messages between
the hub and device."
Hi Kevin,
You are right. I created a service manager and then created a device using the service manager then using the same code I can get the JSON output.
Thanks to everyone for your kind help. I really appreciate it.
Is it possible for you to expand on [quote=ākaznad, post:31, topic:58112ā]
I created a service manager and then created a device using the service manage
[/quote]
I had this same issue, with parse() not getting called by smartthings running refresh().
I fixed it by not just returning the hubAction object, but by calling sendHubCommand(hubAction) in the same place.
thanks.