matthinc / HomeAssistantElectron

Desktop app for Home Assistant based on Electron
151 stars 21 forks source link

Error message on start, "Tray Error" #22

Closed niXta1 closed 6 years ago

niXta1 commented 6 years ago

Hi!

On every start I'm getting:

Tray Error
Unable to connect to https://domain:port/My Nameapis/states?api_password=xyz

I masked the sensitive info.

After I click OK, it continues and seems to be working fine.

matthinc commented 6 years ago

Hi,

this is strange. To avoid this message, you could uncheck "Create tray menu" in Go > Preferences.

What Version of HomeAssistant do you use? What happens, when you enter "https://domain:port/My Nameapis/states?api_password=xyz" in your browser (replace "apis" with "api", little typo in the error message ;) )

Thank you

niXta1 commented 6 years ago

Yes, that avoids it. I'm running official hass 0.70.1 https://domain:port/My Nameapi/states?api_password=xyz Turns up 404: Not found While https://domain:port/api/states?api_password=xyz Turns up with all my devices and states, 5 pages of json.

"My Name" must come from my login name?.

matthinc commented 6 years ago

I really can't image where your name comes from. That's odd.

The affected line code is

client.get(hass + `/api/states?api_password=${password}`, (data, res) => {
    if (data instanceof Buffer) {
      dialog.showErrorBox('Tray error', `Unable to connect to ${hass}/apis/states?api_password=${password}`)
      return
    }

As you can see, the URL is just "<Your HomeAssistant URL>/api/states?api_password=<Your password>" I'm not inserting anything else.

niXta1 commented 6 years ago

Strange. Deleted the app and let iTrash cleanup the leftover files. Installed the latest version again and it's now working. I began using it way back and after that I've just been writing over the old versions with the new ones. Anyway, it works :) Thanks for all work!