Connection to Domoticz defined devices like Blinds and On/Off switches

If you go in the IDE and do live logging, now do an add of the devices again, could you tell me what errors are showing?

I think the problem might be in the fact that i create the devices in my own namespace…

This is a copy-paste of my error log. It seems I don’t get any errors, it just doesn’t do anything…

This is the complete log: Start editing, add devices and finally saving the smartapp again.

19:22:33 CET: debug getChildDevices(false), children=0
19:22:33 CET: debug updateDeviceList()
19:22:33 CET: debug settings: [domoticzTcpPort:8080, domoticzTrace:true, domoticzProtocol:ALL, domoticzIpAddress:10.0.1.105]
19:22:33 CET: debug state: [accessToken:XXX, networkId:10.0.1.105:8080, setup:[deviceType:null, installed:true], devices:[:], url:https://graph.api.smartthings.com/api/smartapps/installations/XXX/]
19:22:33 CET: trace Domoticz Server. Version 1.0.0. Copyright (c) 2015 Martin Verbeek
19:22:33 CET: debug updated()
19:22:26 CET: debug
19:18:19 CET: info evt.source HUB
19:18:06 CET: debug setupMenu()
19:18:05 CET: debug setupMenu()
19:18:00 CET: debug IDX = 0
19:18:00 CET: debug createNetworkId(10.0.1.105, 8080)
19:18:00 CET: debug setupActionTest()
19:17:57 CET: debug setupTestConnection()
19:17:56 CET: debug setupMenu()
19:17:50 CET: debug setupMenu()
19:17:50 CET: debug setupInit()

I catch an error without showing it, it is now showing if there is one. Could you redo the above, after doing an update from repo. Thanks for helping Erik …

Are you Dutch by any chance?

I updated the SmartApp from the repo. Now I did catch the error indeed.

I’m Dutch by the way, guess you’re too based on the name ;). Thank for your help too!

21:23:29 CET: debug getChildDevices(false), children=0
21:23:29 CET: debug updateDeviceList()
21:23:28 CET: debug settings: [domoticzTcpPort:8080, domoticzTrace:true, domoticzProtocol:ALL, domoticzIpAddress:10.0.1.105]
21:23:28 CET: debug state: [accessToken:XXX, networkId:10.0.1.105:8080, setup:[deviceType:null, installed:true], devices:[:], url:https://graph.api.smartthings.com/api/smartapps/installations/XXX/]
b21:23:28 CET: trace Domoticz Server. Version 1.0.0. Copyright (c) 2015 Martin Verbeek
21:23:28 CET: debug updated()
21:23:28 CET: error devicetype:04, mac:XXX, networkAddress:0A000166, deviceAddress:0050, stringCount:03, ssdpPath:/description.xml, ssdpUSN:XXX, ssdpTerm:urn:schemas-upnp-org:device:basic:1
21:23:28 CET: error Error in decodeBase64 of Header. Error: groovy.lang.GroovyRuntimeException: Ambiguous method overloading for method java.lang.String#<init>.
Cannot resolve which method to invoke for [null] due to overlapping prototypes between:
[class [B]
[class [C]
[class java.lang.String]
21:23:28 CET: info evt.source HUB
21:23:28 CET: error devicetype:04, mac:XXX, networkAddress:0A000166, deviceAddress:0050, stringCount:03, ssdpPath:/description.xml, ssdpUSN:uuid:XXX::upnp:rootdevice, ssdpTerm:upnp:rootdevice
21:23:28 CET: error Error in decodeBase64 of Header. Error: groovy.lang.GroovyRuntimeException: Ambiguous method overloading for method java.lang.String#<init>.
Cannot resolve which method to invoke for [null] due to overlapping prototypes between:
[class [B]
[class [C]
[class java.lang.String]
21:23:28 CET: info evt.source HUB
21:23:28 CET: error devicetype:04, mac:XXX, networkAddress:0A000166, deviceAddress:0050, stringCount:03, ssdpPath:/description.xml, ssdpUSN:uuid:XXX, ssdpTerm:uuid:XXX
21:23:28 CET: error Error in decodeBase64 of Header. Error: groovy.lang.GroovyRuntimeException: Ambiguous method overloading for method java.lang.String#<init>.
Cannot resolve which method to invoke for [null] due to overlapping prototypes between:
[class [B]
[class [C]
[class java.lang.String]
21:23:28 CET: info evt.source HUB
21:23:27 CET: error devicetype:04, mac:XXX, networkAddress:0A000166, deviceAddress:0050, stringCount:03, ssdpPath:/description.xml, ssdpUSN:uuid:XXX, ssdpTerm:urn:schemas-upnp-org:device:basic:1
21:23:27 CET: error Error in decodeBase64 of Header. Error: groovy.lang.GroovyRuntimeException: Ambiguous method overloading for method java.lang.String#<init>.
Cannot resolve which method to invoke for [null] due to overlapping prototypes between:
[class [B]
[class [C]
[class java.lang.String]
21:23:27 CET: info evt.source HUB
21:23:27 CET: error devicetype:04, mac:XXX, networkAddress:0A000166, deviceAddress:0050, stringCount:03, ssdpPath:/description.xml, ssdpUSN:uuid:XXX, ssdpTerm:uuid:XXX
21:23:27 CET: error Error in decodeBase64 of Header. Error: groovy.lang.GroovyRuntimeException: Ambiguous method overloading for method java.lang.String#<init>.
Cannot resolve which method to invoke for [null] due to overlapping prototypes between:
[class [B]
[class [C]
[class java.lang.String]
21:23:27 CET: info evt.source HUB
21:23:27 CET: error devicetype:04, mac:XXX, networkAddress:0A000166, deviceAddress:0050, stringCount:03, ssdpPath:/description.xml, ssdpUSN:uuid:XXX::upnp:rootdevice, ssdpTerm:upnp:rootdevice
21:23:27 CET: error Error in decodeBase64 of Header. Error: groovy.lang.GroovyRuntimeException: Ambiguous method overloading for method java.lang.String#<init>.
Cannot resolve which method to invoke for [null] due to overlapping prototypes between:
[class [B]
[class [C]
[class java.lang.String]
21:23:27 CET: info evt.source HUB
b21:23:20 CET: debug setupMenu()
21:23:19 CET: debug setupMenu()
21:23:15 CET: debug IDX = 0
21:23:15 CET: debug createNetworkId(10.0.1.105, 8080)
21:23:15 CET: debug setupActionTest()
21:23:12 CET: debug setupTestConnection()
21:23:11 CET: debug setupMenu()
21:23:08 CET: debug setupMenu()
21:23:08 CET: debug setupInit()

I do see the (similar) errors coming by now even after the SmartApp has been saved.

21:30:36 CET: info evt.source HUB
21:30:36 CET: error raw:8BEA00000FFF0D0000000000, dni:8BEA, normalActual:00000FFF, normalExpected:0D, aggressiveActual:00000000, aggressiveExpected:00
21:30:36 CET: error Error in decodeBase64 of Header. Error: groovy.lang.GroovyRuntimeException: Ambiguous method overloading for method java.lang.String#<init>.
Cannot resolve which method to invoke for [null] due to overlapping prototypes between:
[class [B]
[class [C]
[class java.lang.String]

These are events that are coming from other devices, not from the one i expected…need to do some real debugging. Will be back…

Just to be sure. The ST Hub and the Domoticz Server are on the same local network? Looks like the response from Domoticz is not being detected by the Hub/SmartApp.

They are indeed on the same network. And I got a similar suspicion, seems like SmartThings does not detect the output from Domoticz. Weird, because the notifications sent out by Domoticz are received according to the log of ST.

When in the IDE you go to My Locations, List Smartapps, Select Domoticz Server…do you see the subscription like below?

Actually the Domoticz notifications are send through the cloud, so a complete separate path (also in code). The command to Domoticz and the response are send using the Hub to the local network. In this case i send the JSON command i have showed to the Domoticz server and the response will be on the onLocation handler…when arrived it will define the devices in that JSON response…nothing happens if the response never gets posted…

I get exactly the same. Except of course the “Source” field is different.

One final check to see if Domoticz receives the request from the Hub…restart Domoticz to clean the log and remembered connections. Now go to the smartapp and do “add all devices of a type”, next, done. Check the log in Domoticz and see if there is an incoming connection from the Hub (IP address of the HUB)…

Yes, I see one entry for the initial hub connection in the domoticz log:

2015-11-03 17:39:31.923 Incoming connection from: 192.168.178.79

but still no devices showing up in SmartThings

Sorry for the late reply, I was pretty busy for the last 2 days.

I restarted my Domoticz and performed the “add all devices of a type”. I then get the following message in my Domoticz log (10.0.1.104 is the IP of my SmartThings hub on my home network). It does seem that both BristolBaz and me have the same issue…

2015-11-03 18:57:18.361 Incoming connection from: 10.0.1.104

Was not expecting to see devices defined this was a test to see that the SmartThings Hub command I send i arriving at Domoticz. Previously you have posted a part of the JSON output, could you post the first part of it e.g.

{
“ActTime” : 1446575587,
“ServerTime” : “2015-11-03 19:33:07”,
“Sunrise” : “07:40”,
“Sunset” : “17:08”,
“result” : [
{
“AddjMulti” : 1.0,

This is the first part of the output of the server (http://10.0.1.105:8080/json.htm?type=devices&filter=all&used=true&order=Name):

{
   "ActTime" : 1446576272,
   "ServerTime" : "2015-11-03 19:44:32",
   "Sunrise" : "07:35",
   "Sunset" : "17:07",
   "result" : [
      {
         "Data" : "On",
         "Description" : "",
         "Favorite" : 0,
         "LastUpdate" : "2015-11-02 18:57:47",
         "Name" : "Test",
         "Protected" : false,
         "Status" : "On",
         "Type" : "Scene",
         "TypeImg" : "scene",
         "UsedByCamera" : false,
         "XOffset" : 0,
         "YOffset" : 0,
         "idx" : "1"
      },

Funny to see my day is 4 minutes longer then yours ;).

Ok, i have put on a filter in the request to Domoticz to discard all devices that we cannot use in the smartapp, could you update from repo and do an add all devices and have live logging running during the command and select Domoticz Server only?

PS. The code will now also log the requests to domoticz in the log of Domoticz, you will see SmartThings prefixed messages.

I am now seeing :

2015-11-03 20:57:20.884 Incoming connection from: 192.168.178.79
2015-11-03 20:57:20.884 SmartThings ListDevices

but still no devices.
if I retry the app I get:

2015-11-03 20:58:41.776 SmartThings ListDevices

anything in IDE live logging? Getting crazy here, all is working perfectly here…

only this:

88185bba-9764-46e9-b62e-de592075333e 21:01:41 GMT: debug createNetworkId(192.168.178.21, 8083)
88185bba-9764-46e9-b62e-de592075333e 21:01:41 GMT: debug setupActionTest()
88185bba-9764-46e9-b62e-de592075333e 21:01:39 GMT: debug setupTestConnection()
88185bba-9764-46e9-b62e-de592075333e 21:01:37 GMT: debug setupMenu()
88185bba-9764-46e9-b62e-de592075333e 21:01:37 GMT: debug setupInit()
88185bba-9764-46e9-b62e-de592075333e 21:00:39 GMT: debug setupMenu()
88185bba-9764-46e9-b62e-de592075333e 21:00:39 GMT: debug setupDomoticz()
88185bba-9764-46e9-b62e-de592075333e 21:00:38 GMT: debug getChildDevices(false), children=0
88185bba-9764-46e9-b62e-de592075333e 21:00:38 GMT: debug updateDeviceList()
88185bba-9764-46e9-b62e-de592075333e 21:00:38 GMT: debug settings: [domoticzTrace:true, domoticzProtocol:ALL, domoticzTcpPort:8083, domoticzIpAddress:192.168.178.21]
88185bba-9764-46e9-b62e-de592075333e 21:00:38 GMT: debug state: [accessToken:d93a2794-5bf5-4098-8f25-243e04d38ced, networkId:192.168.178.21:8083, setup:[deviceType:null, installed:true], devices:[:], url:https://graph.api.smartthings.com/api/smartapps/installations/88185bba-9764-46e9-b62e-de592075333e/]
88185bba-9764-46e9-b62e-de592075333e 21:00:38 GMT: trace Domoticz Server. Version 1.0.0. Copyright © 2015 Martin Verbeek
88185bba-9764-46e9-b62e-de592075333e 21:00:38 GMT: debug updated()
88185bba-9764-46e9-b62e-de592075333e 21:00:37 GMT: debug setupMenu()
88185bba-9764-46e9-b62e-de592075333e 21:00:34 GMT: debug setupDomoticz()
88185bba-9764-46e9-b62e-de592075333e 21:00:30 GMT: debug setupMenu()