I’ve just tried it as well… getting similar results.
It has something to do with subscribing to location events. When i changed subscribe to something not working, i got the same results as you. I put in some code to always do unsubscribe and redo subscribe. For me it worked again afterwards. Could you update the code and redo?
I also noticed something new in the IDE with live logging. i now see two instances of Domoticz Server, check both on output. Looks like one of them is listing the events that are coming back from external calls…
I’ve just tried it, but it seems nothing changed for me. My IDE still shows only 1 instance of Domoticz Server and that one is still doing that same as it was before.
I also tried removing and reinstalling the SmartApp, without any changes…
Could I be missing any other device types or something? I’ve installed just the 2 that were on your repo in Github.
And I do have a question. In your code you’re subscribing to “subscribe(location, null, onLocation, [filterEvents:false])
”. But you’re not referring to “location” anywhere else in the code. Is that correct or am I missing something?
location is a property that is automatically injected by the smartthings platform no need to define
Even if the devices are not there or wrong, the log will show the attempt to define something and will display an error if no success. Just tried that with a second instance of the smartapp…
I am going to insert a log write for every statement that is in the event handler that must react on the return of the information from Domoticz.
But in previous log shows that only other hub events are showing…
trace is now committed to repo
PS. are you defined in the UK or the US cloud?
Thank you again for your work with this.
I’m in the UK, still not seeing any devices and just this in the domoticz log:
2015-11-04 19:56:56.513 Incoming connection from: 192.168.178.79
2015-11-04 19:56:56.519 SmartThings ListDevices
i have a US based HUB, sorry trying to make sense of this…did you ran it with the last code, it should show lots of entries in the Smartthing IDE live logging
I have a (about 1 year old) US based hub. Just updated the code and tried to add the devices again. Now the error log in SmartThings does show more…
21:20:58 CET: debug updateDeviceList()
21:20:58 CET: debug Subcribe to Location
21:20:58 CET: debug settings: [domoticzTcpPort:8080, domoticzTrace:true, domoticzIpAddress:10.0.1.105, domoticzProtocol:ALL]
21:20:58 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/]
21:20:58 CET: trace Domoticz Server. Version 1.0.0. Copyright (c) 2015 Martin Verbeek
21:20:58 CET: debug updated()
21:20:55 CET: debug setupMenu()
21:20:54 CET: debug setupMenu()
21:20:49 CET: info statusrsp result : null
21:20:49 CET: info statusrsp : [title:AddLogMessage, status:OK]
21:20:49 CET: info body : {
"status" : "OK",
"title" : "AddLogMessage"
}
21:20:49 CET: info header : null
21:20:49 CET: info hmap : [index:01, mac:XXX, ip:0A000169, port:1F90, requestId:XXX, headers:XXX, body:XXX=]
21:20:49 CET: info description : index:01, mac:XXX, ip:0A000169, port:1F90, requestId:XXX, headers:XXX, body:XXX=
21:20:49 CET: info evt.source HUB
21:20:48 CET: debug IDX = 0
21:20:48 CET: debug createNetworkId(10.0.1.105, 8080)
21:20:48 CET: debug setupActionTest()
21:20:40 CET: debug setupTestConnection()
21:20:40 CET: debug setupMenu()
21:20:37 CET: debug setupMenu()
21:20:37 CET: debug setupInit()
This makes things even weirder…the response on the command to write a log entry is received back to the hub from domoticz, so the events are being seen. But not the response from the list itself
Just for arguments sake, could you wait a little before leaving the setup? I think it should not matter, but just to be sure…
i have waited a while but unfortunately still no devices! It is all very odd.
When I get chance I will build a new domoticz instance and try again.
I now waited a little longer (about 1 minute or so) and I did actually get some more things in my logging. No devices yet however…
22:18:55 CET: info statusrsp result : null
22:18:55 CET: info statusrsp : [title:AddLogMessage, status:OK]
22:18:55 CET: info body : {
"status" : "OK",
"title" : "AddLogMessage"
}
22:18:55 CET: info header : null
22:18:55 CET: info hmap : [index:01, mac:XXX, ip:0A000169, port:1F90, requestId:XXX, headers:XXX, body:XXX=]
22:18:55 CET: info description : index:01, mac:XXX, ip:0A000169, port:1F90, requestId:XXX, headers:XXX, body:XXX=
22:18:55 CET: info evt.source HUB
22:18:54 CET: debug IDX = 0
22:18:54 CET: debug createNetworkId(10.0.1.105, 8080)
22:18:54 CET: debug setupActionTest()
22:19:16 CET: info hmap : [devicetype:04, mac:XXX, networkAddress:0A000166, deviceAddress:0050, stringCount:03, ssdpPath:/description.xml, ssdpUSN:uuid:XXX, ssdpTerm:urn:schemas-upnp-org:device:basic:1]
22:19:16 CET: info description : devicetype:04, mac:XXX, networkAddress:0A000166, deviceAddress:0050, stringCount:03, ssdpPath:/description.xml, ssdpUSN:uuid:XXX, ssdpTerm:urn:schemas-upnp-org:device:basic:1
22:19:16 CET: info evt.source HUB
22:19:15 CET: info hmap : [devicetype:04, mac:XXX, networkAddress:0A000166, deviceAddress:0050, stringCount:03, ssdpPath:/description.xml, ssdpUSN:uuid:XXX::upnp:rootdevice, ssdpTerm:upnp:rootdevice]
22:19:15 CET: info description : devicetype:04, mac:XXX, networkAddress:0A000166, deviceAddress:0050, stringCount:03, ssdpPath:/description.xml, ssdpUSN:uuid:XXX::upnp:rootdevice, ssdpTerm:upnp:rootdevice
22:19:15 CET: info evt.source HUB
22:19:14 CET: info hmap : [devicetype:04, mac:XXX, networkAddress:0A000166, deviceAddress:0050, stringCount:03, ssdpPath:/description.xml, ssdpUSN:uuid:XXX, ssdpTerm:uuid:XXX]
22:19:14 CET: info description : devicetype:04, mac:XXX, networkAddress:0A000166, deviceAddress:0050, stringCount:03, ssdpPath:/description.xml, ssdpUSN:uuid:XXX, ssdpTerm:uuid:XXX
22:19:14 CET: info evt.source HUB
22:19:14 CET: info hmap : [devicetype:04, mac:XXX, networkAddress:0A000166, deviceAddress:0050, stringCount:03, ssdpPath:/description.xml, ssdpUSN:uuid:XXX::upnp:rootdevice, ssdpTerm:upnp:rootdevice]
22:19:14 CET: info description : devicetype:04, mac:XXX, networkAddress:0A000166, deviceAddress:0050, stringCount:03, ssdpPath:/description.xml, ssdpUSN:uuid:XXX::upnp:rootdevice, ssdpTerm:upnp:rootdevice
22:19:14 CET: info evt.source HUB
22:18:48 CET: debug setupTestConnection()
22:18:39 CET: debug setupMenu()
22:18:48 CET: debug setupMenu()
22:18:38 CET: debug setupMenu()
22:18:34 CET: debug setupDomoticz()
22:18:33 CET: debug setupMenu()
22:18:28 CET: debug setupMenu()
22:18:28 CET: debug setupInit()
I haven’t had the time to test your work out earlier, but I got it working quite fast.
My setup:
SmartThings V2 UK hub
Domoticz V2.3213 running on Raspberry Pi B (type 1)
RFXCOM - RFXtrx433 USB 433.92MHz Transceiver
Somfy Blinds (4 in total)
I also have a busload of Philips Hue and Living Whites devices (bulbs and on/off switches), but I decided not to assign them yet because I am planning to reset my whole home setup because I am having weird problems on the Philips side, no use making it more complicated
So I have selected only the ‘Blinds’ type.
In the “Custom HTTP/Action:” I have added in FIELD#1:
https://graph-eu01-euwest1.api.smartthings.com/api/smartapps/installations/(code from URL of SmartApp when editing it)/EventDomoticz?access_token=(OAuth Client ID from App Settings)&message=#MESSAGE
(this is the UK server)
Because I have a password set up on my Domoticz server, I needed to whitelist my local network to work without authentication, in Domoticz->Settings->System add to “Local Networks (no username/password)” a wildcard for your own local network (for example “192.168.1.*”).
Then I went to the Switches menu in Domoticz, selected the blind I wanted to control, clicked ‘Notifications’ and added the 'Switch On" and “Switch Off” notifications for “http” only.
After that searching for connected devices gave me a list of my 4 blinds, and I can control them just as expected.
The only thing that doesn’t seem to work is the status notifications of the blinds. I am only seeing the status change when I control the blinds from within ST, but when I open/close them through Domoticz the status in ST stays the same.
The ST app does not reflect the current status (open/closed/stopped), even though I can see in the ST logfiles when I refresh the blind the correct status:
"LastUpdate" : "2015-11-06 19:22:02",
"Level" : 0,
"LevelInt" : 0,
"MaxDimLevel" : 0,
"Name" : "Rolluik studeerkamer",
"Notifications" : "true",
"PlanID" : "0",
"PlanIDs" : [ 0 ],
"Protected" : false,
"ShowNotifications" : true,
"SignalLevel" : 7,
"Status" : "Closed",
So even though it says “Closed” here, in the ST app, the current status remains “STOPPED”.
edit:
When I am looking through the domoticzBlinds device type, I see references to “switch” instead of “blinds” in the event parsing part, could it be that this needs to be changed? And in the Domoticz Server in the last few lines I see references to the US server. Should we change this to the UK server when using the UK V2 hub?
And one more edit: could this be affecting other UK hub owners with this project as well?
In the “Custom HTTP/Action:” I have added in FIELD#1: your connection to ST…
do not enter this in FIELD#1 but in URL/Action. Nothing in FIELDs.
Arnoud has found what is going on here and why devices are not being seen. I have tested it with and without the local network in the settings…
Because I have a password set up on my Domoticz server, I needed to whitelist my local network to work without authentication, in Domoticz->Settings->System add to “Local Networks (no username/password)” a wildcard for your own local network (for example "192.168.1.").*
please test in your setup Erik and BristolBaz…
@Arnoud, you will not see the Somfy status Stopped reported back, this is not supported by Domoticz it will just send the status ON and OFF for blinds.
Are you sure? @dudz40
As I said, when I hit the refresh button on a certain blind, I clearly see this appearing in the ST Live Logging:
20:31:10: info statusrsp : [result:[[YOffset:0, SignalLevel:7, PlanID:0, Type:RFY, HaveTimeout:false, XOffset:0, AddjValue2:0.0, Notifications:true, Protected:false, IsSubDevice:false, Unit:2, HardwareName:RFXtrx443E, StrParam1:, Data:Open, StrParam2:, LastUpdate:2015-11-06 19:51:30, AddjMulti:1.0, Image:Light, ID:026668, SwitchTypeVal:3, HardwareID:2, Timers:false, Favorite:1, SwitchType:Blinds, Description:, idx:7, MaxDimLevel:0, AddjMulti2:1.0, PlanIDs:[0], LevelInt:0, HardwareType:RFXCOM - RFXtrx433 USB 433.92MHz Transceiver, CustomImage:0, BatteryLevel:255, HaveDimmer:false, UsedByCamera:false, ShowNotifications:true, TypeImg:blinds, Name:Rolluik woonkamer, Status:Open, AddjValue:0.0, Used:1, HardwareTypeVal:1, HaveGroupCmd:false, Level:0, SubType:RFY]], title:Devices, status:OK, Sunset:17:02, ActTime:1446838270, Sunrise:07:41, ServerTime:2015-11-06 20:31:10]
With “Status: Open” (or Stopped/Closed) whatever the status.
Actually also Blinds are of the “switch” type, for somfy i added the stop command. But being of the switch type has advantages, all apps that are working with On and Off can now be used to act on your blinds…like raise a blind when you open a door, close them at sunset…etc…
This is not the status being reported back . For this i have to rely on Domotics sending out status independent of the SmartApp. That is being done with the Domoticz Notifications stuff. That subsystem only sends On or Off. As an example i have some Rolluiken that use klikaanklikuit and when i use the remote that comes with KAKU it gets reported back into the smartapp. This unfortunatly does not work for Somfy remotes. It is not detected by tthe RFXCOM (i have somfy as well).
I understand that this is not always the current status of the blinds, because I can use the remote and mess things up But if I only use Domoticz to control my blinds, this value should actually represent the current status of my blinds, right? In all my testing today it seems that this reported value in the ST logs is exactly the state of my blinds.
It can only be ON (closed) or OFF (Open). you will see a message in domoticz log that sends the status to St…something like
2015-11-06 20:45:51.510 Notification sent (http) => Success
So the device in ST should say Open/Closed. But i will have a checkup on it…thanks for helping!
Ok, cool. I am glad I can at least control my blinds, so the current status is slightly less important. But since I am currently triggering auto-up/down at certain times of the days from within Domoticz, checking the actual status would be very welcome.
But is there a need for UK hub users to change anything to the sourcecode? As I said, I am seeing references to the US server in there?