Skip to content
This repository has been archived by the owner on Jul 15, 2021. It is now read-only.

Smart app broken with the new update #27

Closed
KumarMudedla opened this issue Feb 12, 2016 · 36 comments
Closed

Smart app broken with the new update #27

KumarMudedla opened this issue Feb 12, 2016 · 36 comments

Comments

@KumarMudedla
Copy link
Contributor

I just updated my smart app and it looks like it is broken, I wasn't able to open the app and it is creating multiple instances. I deleted it and now I am using old version.

@rickybloomfield
Copy link

Same here - doesn't open after the new update (with the new icon).

@asrusch
Copy link

asrusch commented Feb 12, 2016

Same here.

@tonesto7
Copy link
Owner

This is odd seeing as nothing has changed except the deviceQuery method. Are you seeing any errors in the IDE logs

@KumarMudedla
Copy link
Contributor Author

below is the error I am seeing in IDE, while trying to open the app

error java.lang.NullPointerException: Cannot get property 'authorities' on null object @ line 25

@tonesto7
Copy link
Owner

That because Oauth is not enabled under the smart app settings in the IDE

@tonesto7
Copy link
Owner

i'm not sure why if it was enabled before that it wouldn't now, but honestly SmartThings changes/breaks something new everyday

@asrusch
Copy link

asrusch commented Feb 12, 2016

I have confirmed I have oAuth enabled (and the app is not working).

On Thursday, February 11, 2016, Tonesto7 notifications@github.com wrote:

i'm not sure why if it was enabled before that it wouldn't now, but
honestly SmartThings changes/breaks something new everyday


Reply to this email directly or view it on GitHub
#27 (comment)
.

@tonesto7
Copy link
Owner

Are you in the US? or UK? Maybe ST is having issues with oauth...
The only other thing to test would be be to install a second instance of the app and see if it still crashes. If it doesn't then delete the old app and add the new config for the new endpoint to homebridge.

@asrusch
Copy link

asrusch commented Feb 12, 2016

I am US.

I think it would be good to ask- it should open without any homebridge
config, right?

From what I understand, I have to open the app first to know what settings
to enter into my homebridge config file.

Thanks for your help.

On Thursday, February 11, 2016, Tonesto7 notifications@github.com wrote:

Are you in the US? or UK? Maybe ST is having issues with oauth...
The only other thing to test would be be to install a second instance of
the app and see if it still crashes. If it doesn't then delete the old app
and add the new config for the new endpoint to homebridge.


Reply to this email directly or view it on GitHub
#27 (comment)
.

@tonesto7
Copy link
Owner

I'm pretty sure this api isn't using the new oauth authentication methods to expose the endpoint. (This should be addressed before ST flips the switch on these older methods.

@tonesto7
Copy link
Owner

Correct... Once you open the app the first time it will generate a token that will be added to the config.json file the application generates

@Jarretpayne
Copy link

I can't seem to get it to work. When I go on the app on my phone, I can see the JSON complete API, but if i touch it, it doesn't do anything....

@tonesto7 tonesto7 mentioned this issue Feb 12, 2016
@tonesto7
Copy link
Owner

That one is my bad and I apologize for the inconvenience it caused.
I wasn't handling the null values when the device input or sensor input was empty.

I just submitted the pull request to fix this issue.

@Jarretpayne
Copy link

Thank you for the response to this,

I am new to all of this and I wanted to make sure it was something I wasn’t doing incorrectly.

I did have to do something different than on the instructions. I can’t seem to link my smartthings account with github. I get the whole 404 page not found. So I worked around it by copying the code information and created it as my “own” smart app. Does that cause any problems?

On Feb 12, 2016, at 8:29 AM, Tonesto7 notifications@github.com wrote:

That one is my bad and I apologize for the inconvenience it caused.

I wasn't handling the null values when the device input or sensor input was empty.

I just submitted the pull request to fix this issue.


Reply to this email directly or view it on GitHub #27 (comment).

@tonesto7
Copy link
Owner

@Jarretpayne
No it will not cause any issues at all. Just remember to publish for me 😄

@Jarretpayne
Copy link

Will do my friend, thank you. Will I simply need to keep checking the webpage to see if it has been update?

On Feb 12, 2016, at 9:32 AM, Tonesto7 notifications@github.com wrote:

@Jarretpayne https://github.com/Jarretpayne
No it will not cause any issues at all. Just remember to publish for me


Reply to this email directly or view it on GitHub #27 (comment).

@asrusch
Copy link

asrusch commented Feb 12, 2016

@Jarretpayne - I had the same issue with you getting my github integration (404). The trick is that you need to create a Repository on your github called "SmartThingsPublic". Click the "+New Repository" on the right side under "Your Repositories," name it SmartThingsPublic, and click "Create Repository." Then you can integrate Smartthings IDE with github. And then you are able to add pdlove repo afterward, and the readme makes sense.

Also- pdlove commited the changes and the working code is now live. I have confirmed that it is working.

@pdlove
Copy link
Contributor

pdlove commented Feb 12, 2016

Can someone help me out... what do I need to do to view the log.debug stuff that an app outputs? I don't see any of it in the log (even using log.error) and it's making my work on subscriptions really difficult.

@tonesto7
Copy link
Owner

just for example: if you uncomment line 168 and 172 of the smartapp and publish you should begin to see every device query made in the Live Logging IDE https://graph.api.smartthings.com/ide/logs

@pdlove
Copy link
Contributor

pdlove commented Feb 12, 2016

@tonesto7 Is that even running it from the IDE in simulation?
I just tested it with a Published app and I'm still seeing "Info": Waiting on events.

@tonesto7
Copy link
Owner

Not unless the simulated device was being polled by homebridge (if that's possible to-do)... I always forget about the Simulator because it rarely ever worked for me in the past.
Can you share the code you're having issues with?

@pdlove
Copy link
Contributor

pdlove commented Feb 12, 2016

I just uncommented line 168 and 172 as you suggested and I'm not getting any events in the logs when polling.
I don't have any code at the moment I'm having problems with, but I'm getting ready to start working on an addon to the JSON that will subscribe to events and store device changes so that every half second, homebridge will be able to grab the changes. If changes are not available during the poll, the http would be kept open until it either timed out or changes were available.
As part of this, I need to be able to use the logging to get a feel for what is going on.

@Jarretpayne
Copy link

I updated everything and I was able to go to the next screen and selected all the devices. I am not home so I cannot check things out. I assume now I would be able to control things by talking to siri? Be it setting the alarm or routines?

On Feb 12, 2016, at 11:04 AM, pdlove notifications@github.com wrote:

I just uncommented line 168 and 172 as you suggested and I'm not getting any events in the logs when polling.
I don't have any code at the moment I'm having problems with, but I'm getting ready to start working on an addon to the JSON that will subscribe to events and store device changes so that every half second, homebridge will be able to grab the changes. If changes are not available during the poll, the http would be kept open until it either timed out or changes were available.
As part of this, I need to be able to use the logging to get a feel for what is going on.


Reply to this email directly or view it on GitHub #27 (comment).

@tonesto7
Copy link
Owner

I've noticed lately that the logger has a lot of issues with certain exceptions not even being output even if they are handled appropriately.
Try adding a log.debug "Logging test..." in a place that is guaranteed to be hit.

@asrusch
Copy link

asrusch commented Feb 12, 2016

@Jarretpayne Now you need to go to your server where you installed homebridge (https://github.com/nfarina/homebridge/) and create/edit the config.json file. After that, you start homebridge on the server and add homebridge to your homekit on your phone.

@pdlove
Copy link
Contributor

pdlove commented Feb 12, 2016

@tonesto7 I attached the groovy app I'm using to test this. When I turn on light number 1, it turns on light number 2 but doesn't log anything. I'll look up how to contact smartthings about it.
Do you know if the hub is involved? Maybe I need to reboot mine...

lighttest.txt

@tonesto7
Copy link
Owner

let me take a look at it... I noticed that i'm not getting any logs coming in from the Json app so not sure what that is about. I seeing logs from other apps just fine.
but no the hub plays no role in this part. The logs are generated entirely in the cloud.

@pdlove pdlove closed this as completed Feb 12, 2016
@tonesto7
Copy link
Owner

@pdlove I just ran the app and it's outputting the evt.value like it should.

I recommend that you close out all instances of your browser and if you can reboot you computer.

@pdlove
Copy link
Contributor

pdlove commented Feb 12, 2016

@tonesto7 I just got an email back from support that some accounts are affected by an ongoing issue. sigh I'm the odd man out.

@Jarretpayne
Copy link

I am sorry to bug you again, before i get home to do that, I am unclear on the create/edit of the config.json file. Can you dumb that down for me? I appreciate your patience.

On Feb 12, 2016, at 11:41 AM, coolcom notifications@github.com wrote:

@Jarretpayne https://github.com/Jarretpayne Now you need to go to your server where you installed homebridge (https://github.com/nfarina/homebridge/ https://github.com/nfarina/homebridge/) and create/edit the config.json file. After that, you start homebridge on the server and add homebridge to your homekit on your phone.


Reply to this email directly or view it on GitHub #27 (comment).

@asrusch
Copy link

asrusch commented Feb 12, 2016

Are you using linux or ? for your homebridge server? I assume you've already installed homebridge on your server..right?

@Jarretpayne
Copy link

I have a mac.

On Feb 12, 2016, at 2:48 PM, coolcom notifications@github.com wrote:

Are you using linux or ? for your homebridge server? I assume you've already installed homebridge on your server..right?


Reply to this email directly or view it on GitHub #27 (comment).

@asrusch
Copy link

asrusch commented Feb 12, 2016

Ok- well you need to get homebridge installed. I think this may help you.

https://www.reddit.com/r/homeautomation/comments/3ysgbb/homebridge_how_to_on_mac/

Then, you have to create the config.json file in the .homebridge folder.

Something like:

{
    "bridge": {
        "name": "Homebridge",
        "username": "00:11:22:33:44:55",
        "port": 51826,
        "pin": "012-34-567"
    },

"platforms": [

{
   "platform": "homebridge-smartthings.SmartThings",
    "name": "SmartThings",
    "app_url": "https://graph.api.smartthings.com:443/api/smartapps/installations/",
    "app_id": "APP-ID-FROM-SMARTAPP-ON-PHONE",
    "access_token": "TOKEN-FROM-SMARTAPP-ON-PHONE",
    "polling_seconds": 10
}
]
}

@tonesto7
Copy link
Owner

There is a button at the bottom of the SmartApp that creates the file. Just use the share function of iOS to share it. It will share as a direct link to download the file.

@asrusch
Copy link

asrusch commented Feb 12, 2016

@tonesto7 it doesn't create the full config.json file required. You need the bridge part, otherwise it won't work.

@tonesto7
Copy link
Owner

removed

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

No branches or pull requests

6 participants