Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Device Listing #3

Open
joedix opened this issue Jul 16, 2015 · 8 comments
Open

Device Listing #3

joedix opened this issue Jul 16, 2015 · 8 comments

Comments

@joedix
Copy link

joedix commented Jul 16, 2015

When I type python smartthings.py --type motion
only a single motion detection is listed, this also applies to contact and switch
It is always the same device listed (i.e. fr dr, hall switch, lv motion).
The information that is returned is correct.

When I try to get info / make request using type & id (string) or actual, the reply that is returned is "[]" (Left and Right open square brackets)

How can I list all motions / contacts / switches?

How can I request change to switch other than the one listed.

I currently have 35 devices, all similar, all working with the iotdb-smartthings app, as far as I know.

I do receive status changes via iotdb-mqtt.

@dpjanes
Copy link
Owner

dpjanes commented Jul 16, 2015

I suspect that you just need to approve your app to see these devices, using the iOS or Android app. If you haven't approved them, they won't show up and can't be accessed.

@joedix
Copy link
Author

joedix commented Jul 16, 2015

I have approved all my physical devices (no 3axis).
-- removed screenshot--

@dpjanes
Copy link
Owner

dpjanes commented Jul 16, 2015

I don't know how to interpret that page, as I don't have the Android app. You may have to play with it a bit to get the approvals you want

Multiple devices is definitely supported, e.g. I just did this

$ python smartthings.py --type contact
[
  {
    "id": "aa1a5c63-a58c-4332-9bdb-000000000000",
    "label": "SmartSense Multi 1",
    "mqtt": "tcp://mqtt.iotdb.org/u/dpjanes/st/contact/aa1a5c63-a58c-4332-9bdb-000000000000",
    "type": "contact",
    "url": "https://graph.api.smartthings.com/api/smartapps/installations/817c3022-7b41-42f1-ac71-000000000000/contact/aa1a5c63-a58c-4332-9bdb-000000000000",
    "value": {
      "contact": true,
      "timestamp": "2014-10-17T19:23:49.002Z"
    }
  },
  {
    "id": "8cd0bf8a-b64d-437c-864f-000000000000",
    "label": "SmartSense Multi 2",
    "mqtt": "tcp://mqtt.iotdb.org/u/dpjanes/st/contact/8cd0bf8a-b64d-437c-864f-000000000000",
    "type": "contact",
    "url": "https://graph.api.smartthings.com/api/smartapps/installations/817c3022-7b41-42f1-ac71-000000000000/contact/8cd0bf8a-b64d-437c-864f-000000000000",
    "value": {
      "contact": false,
      "timestamp": "2015-06-04T22:08:46.150Z"
    }
  }
]

@joedix
Copy link
Author

joedix commented Jul 16, 2015

Maybe this will help, I changed my smartapp api keys, re-ran the iotdb api for smartthings and specifically did not authorize the single switch that was showing up. After copy and pasting the new smartthings.json the same swtich appeared.

When I reran python smartthings.py --type switch , I received the same (unauthorized switch), this lead me to believe that there was another place to authorize the devices. I logged into https://graph.api.smartthings.com/ide/apps and ran through the set location and marked the devices I wanted to use, also noted that if a physical device did not exist, I needed to select a virtual device for that device category.

I test this route more than once and am confident that this is the where items are authorized.

Also tested, returning to https://iotdb.org/playground/oauthorize/smartthings and entering the info, then authorizing only 1 device per category. Saved the new smartthings.json data, and reran python smartthings.py --type motion the result was all the motions I had authorized in the smartthings smartapps page and not the iotdb/smartthings page.

Overall, I don't know why, but I am happy with the results.

@dpjanes
Copy link
Owner

dpjanes commented Jul 16, 2015

If you're happy, I'm happy. May I ask what you're doing with all this?

@dpjanes
Copy link
Owner

dpjanes commented Jul 16, 2015

I'll also update my docs when I get the chance.

@joedix
Copy link
Author

joedix commented Jul 16, 2015

Up-to now I was using the iotdb-mqtt bridge to get smartthings events info to my raspberry pi network, and announce door opening and closing events. The second half, being able to send light controls via python and node-red (via python) will allow my raspi network to turn on or off all the lights.

@dpjanes
Copy link
Owner

dpjanes commented Jul 16, 2015

I strongly encourage you to look at HomeStar / IOTDB, which is a much more comprehensive framework for deal with all of these things! I can walk you through the bits if you want.

Start here:
https://homestar.io/about

iOS app coming soon to control it, plus a complete SQL-like query language
https://github.com/dpjanes/iotdb-iotql

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants