gytisgreitai / openhab-google-home

13 stars 1 forks source link

Add logging for errors #7

Closed mtzro2003 closed 4 years ago

mtzro2003 commented 4 years ago

When I try to sync my devices, Google responds with Sorry, something went wrong..., but nothing get's logged into the container logs. I know I did some intensive editing to my items and I cannot pinpoint where is the problem... Looking at the items definitions and metadata everything looks pretty normal. Only if the app would log somehow what's the problem... :smile: I was working on my TV items and I think I didn't change something elsewhere, but... who knows...? Is it doable?

gytisgreitai commented 4 years ago

if you are running the app-only docker image, you should at least see a SYNC request, if it's not there, then google is not hitting the endpoint and it probably has nothing to do with the items...

mtzro2003 commented 4 years ago

Yes, app-only, but I don't see anything logged when asking sync my devices. However all other commands work and there is the reponse logged. So, I guess the endpoint is working. I tried numerous times to sync.

On Fri, Nov 22, 2019, 21:22 Gytis Ramanauskas notifications@github.com wrote:

if you are running the app-only docker image, you should at least see a SYNC request, if it's not there, then google is not hitting the endpoint and it probably has nothing to do with the items...

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/gytisgreitai/openhab-google-home/issues/7?email_source=notifications&email_token=AAQWPISFBGMZVIP2L775IGLQVAWPDA5CNFSM4JQRHWWKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEE6TRTI#issuecomment-557660365, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAQWPIVXLCO4S4YY3RSEE4TQVAWPDANCNFSM4JQRHWWA .

gytisgreitai commented 4 years ago

So everything else is working but there is no sign of sync? I mean you don't even see something like

Request {
  "inputs": [
    {
      "intent": "action.devices.SYNC"
    }
  ],
  "requestId": "12312312312"
}

?

mtzro2003 commented 4 years ago

Exactly, everything works, but no sign of sync. Earlier today, when sync was successful, the request was logged. In fact, you can see the SYNC in my previous ticket, where I posted the container logs. Having finished with the TVs and channels I want to add the REMOTECONTROL item that I previously commented out. And sync throws the error. I commented back the remote item... Sync throws error... So, I'm guessing that some other edit prohibits the sync. I could try to unlink and re-link... But what if it doesn't work? :smile: I'd be left with nothing :laughing:

Is the SYNC supposed to log the request even if it somehow fails? Or it log only when successful?

On Fri, Nov 22, 2019, 21:49 Gytis Ramanauskas notifications@github.com wrote:

So everything else is working but there is no sign of sync? I mean you don't even see something like

Request { "inputs": [ { "intent": "action.devices.SYNC" } ], "requestId": "12312312312" }

?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/gytisgreitai/openhab-google-home/issues/7?email_source=notifications&email_token=AAQWPIWHF2YIX3GKAKXUWA3QVAZTJA5CNFSM4JQRHWWKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEE6V2MA#issuecomment-557669680, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAQWPIQKUSODUVQVFFGQM73QVAZTJANCNFSM4JQRHWWA .

gytisgreitai commented 4 years ago

Well my understanding that it should log always, but this is internals of google sdk, haven't looked through the code. ` I've pushed a version with local logging on error, you can try pulling latest and see if it works better.

mtzro2003 commented 4 years ago

I pulled the latest version... Nope, it's doesn't log anything when sync fails. What do you think? Should I unlink and re-link?

mtzro2003 commented 4 years ago

Some update... So... I unlinked and re-linked... Error, of course, but I know have some feedback in the log:

OpenHAB Google Home Integration listening on 3000                                                                                                        
token obj { token_type: 'bearer',                                                                                                                        
  access_token: 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX',                                                                      
  expires_in: 86400,                                                                                                                                     
  refresh_token: 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX' }                                                                    
token obj { token_type: 'bearer',                                                                                                                        
  access_token: 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX',                                                                      
  expires_in: 86400,                                                                                                                                     
  refresh_token: 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX' } 

Maybe it's something Google related, because I removed all items files I edited yesterday and it still won't link...

mtzro2003 commented 4 years ago

Well... I got it working again... I deleted the project and re-created it and it linked. I think this was Google related because gactions wanted to update:

$ ./gactions test --action_package action.json --project project-id
Update available to version: 2.2.4
This update is mandatory. gactions will exit if update is not performed.
Would you like to update? (y/n)
y
Performing update...
Successfully updated to the latest version. Please re-issue your command.

$ ./gactions test --action_package action.json --project project-id
Pushing the app for the Assistant for testing...
Gactions needs access to your Google account. Please copy & paste the URL below into a web browser and follow the instructions there. Then copy and paste the authorization code from the browser back here.
Visit this URL:
.......................................................

Now I'm able to get back to my REMOTECONTROLs :laughing:

P.S. Gytis, you did such an amazing work this! I enlist myself as a beta-tester for any modifications and/or new features! Great job!

gytisgreitai commented 4 years ago

Hm this is really strange. I have not had any similar problems while testing. Well this whole app is beta, but afaik soon the official integration will also support metadata, so you will be able to switch back.

mtzro2003 commented 4 years ago

Actually, if you don't intend to give up this project, I don't intemd to switch back to 'official' :) The official implementation is tied to myopenhab - the official site or a self-hosted one. I prefer the simplicity of your version...

On Sat, Nov 23, 2019, 21:22 Gytis Ramanauskas notifications@github.com wrote:

Hm this is really strange. I have not had any similar problems while testing. Well this whole app is beta, but afaik soon the official integration will also support metadata, so you will be able to switch back.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/gytisgreitai/openhab-google-home/issues/7?email_source=notifications&email_token=AAQWPITM6SPLPH62ML6XUPDQVF7IZA5CNFSM4JQRHWWKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEE734AY#issuecomment-557825539, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAQWPIW536IOZY7MFX5ZPCTQVF7IZANCNFSM4JQRHWWA .