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

/homeassistant/entities not found #76

Open
FezVrasta opened this issue May 21, 2018 · 18 comments
Open

/homeassistant/entities not found #76

FezVrasta opened this issue May 21, 2018 · 18 comments

Comments

@FezVrasta
Copy link

Hi I'm having the same problem of #52, it worked fine a week ago. I'm on latest Hass and Node-RED and node-red-contrib-home-assistant

@SierraLimaOscar
Copy link

Same problem.
My setup:
I run node-red on a raspbian pi3 with the IP of 192.168.0.10
I run hass.io (created with the hass.io image) on a separate pi3 with the IP of 192.168.0.11

If I put http://192.168.0.11:8123 as my base URL in the server node settings I get the following error:
"Cannot GET /homeassistant/entities"

If I manually check the URL http://192.168.0.11:8123/homeassistant/entities I get a 404 error.
All my homeassistant folders seem to be at http://192.168.0.11:8123/
eg. http://192.168.0.11/history returns the states history page.

@FezVrasta
Copy link
Author

/homeassistant/entities is a Node-RED Home Assistant endpoint AFAIK, it has nothing to do with your Hass instance.

@FezVrasta
Copy link
Author

FezVrasta commented May 21, 2018

Oh, @AYapejian I figured out where's the problem, it should look for /node-red/homeassistant/entities in my case, because I configured node-red to be served from the /node-red route (it's a Node-RED option).

I think your lib should take in account that option.

@SierraLimaOscar
Copy link

SierraLimaOscar commented May 21, 2018

@FezVrasta - OK I get the endpoint comment. Thanks.
Weird thing is that while I was trying to figure out what was going on it started working. The only thing I did that might of had an impact was a reset of the hassio host while looking at the tcp traffic.
Anyway disregard the above post since a base URL of "http://192.168.0.11:8123" now works.

@blahlt
Copy link

blahlt commented Jun 9, 2018

Me too, but I have "fix" :)
/homeassistant/entities (http://localhost:1880/homeassistant/entities) is Node-RED endpoint and it started return values (not 404) actually when I configured (set "Base URL" and "API Pass") Server property in "events: state" node and deployed flow.

My configuration:
Home Assistant 0.65.6
Node-RED 0.18.7

@KmanOz
Copy link

KmanOz commented Jun 18, 2018

I run HomeAssistant & Node-Red on a standard Debian Buster server not a Pi or HASS.IO or a docker image. Just plain old HomeAssistant. I do not have external ports open nor do I have a DDNS name pointing back to my server. Any external interaction I use HomeKit/HomeBridge and thus Apples security. No issues at all.

Try to get node-red-contrib-home-assistant and HASS communicating is next to impossible. I have tried so many variations of internal address. In fact HomeBridge is on the same server and has no issues talking to HASS. Everywhere I look (HASS Community & Reddit) this seems to be a reoccurring issue and people are saying use an external address. I just don't want to open ports.

Has this been addressed somewhere I am unaware of? Looking forward to getting it going.

Cheers

@ghost
Copy link

ghost commented Jun 19, 2018

So what is the fix here, the other thread was a confusing mess and then closed?

Just deploy a flow and it will start working?

@KmanOz
Copy link

KmanOz commented Jun 19, 2018

I tried deploying a flow when it said that it could not communicate with HomeAssistant. Got stuck in an endless loop of trying to find the HomeAssistant instance. In fact after deleting the flow was still trying to communicate with HomeAssistant and failing. I had to delete all the .json files in .node-red and start it again. This is very frustrating :D

@ghost
Copy link

ghost commented Jun 19, 2018

Has anyone been able to get this to work with home-assistant? Not hassio but home-assistant? Preferably without ssl. What servername was used? Ip Address and port or FQFN? What steps were taken?

This is frustrating because I left hassio to have more flexibility and because of problems with ring, environment and directory locations being different between the two. I swear docker is supposed to make deployment and configuration simple amd just work between hosts. But why is it that nothing ever works right and because there is some many different install options and configurations, what fixed something for someone usually doesn’t work for another. This makes tracking down and troubleshooting a problem hella frustrating. Like hassio on pi is different than hassio docker on ubuntu, is different than home assistant docker, is different than home-assistant installed in a python environment. FFS this frustrating as hell.

@schford
Copy link

schford commented Jun 25, 2018

blahlt - could you provide a little more detail on how you did this please.

I have worked out that the cause of the error is when you change the httpRoot as per below.

Iif you change http route then it no longer pulls the data form home assistant - anyone got any ideas? I need to change the http root to be able to reverse proxy with lets encrypt

// The following property can be used in place of 'httpAdminRoot' and 'httpNodeRoot',
// to apply the same root to both parts.
httpRoot: '/node-red',

So for me it should be pulling the data from http://192.168.0.19:1880/node-red/homeassistant/entities

But it is actually trying to pull it from http://192.168.0.19:1880/homeassistant/entities

@schford
Copy link

schford commented Jun 25, 2018

On line 47 of server-events-state-changed.html - we can see the url it fetches to show entities, as it does not take into account httpRoot variable I have done a quick and dirty hard code - I am sure there must be a better way of fixing this but I am not a coder :-( as you can see below all I have done is manually put in the additional info for my installation.

            $.get('/node-red/homeassistant/entities').done((entities) => {

@smadgerano
Copy link

smadgerano commented Jul 25, 2018

Fault seems to be here, lines 41 - 48?

https://github.com/AYapejian/node-red-contrib-home-assistant/blob/master/nodes/config-server/config-server.js

Switching the '/homeassistant/entities' to 'api/entities' etc, not a dev so not sure

@kevinduong
Copy link

I could go through and refactor all instances where it doesn't include the httpRoot

I'll also see what changing
this.RED.httpAdmin.get('/homeassistant/entities', httpHandlers.getEntities.bind(this));
to
this.RED.httpRoot.get('/homeassistant/entities', httpHandlers.getEntities.bind(this));

Does when I get home from work tonight. If I submit a PR, it'll be to Spartan-II's fork. Since the author of this repo no longer seems to respond to PRs

@schford
Copy link

schford commented Jul 26, 2018

Thanks - could you post here when it is done so we can update to new fork :-)

@PITP2
Copy link

PITP2 commented Aug 11, 2018

Hi,

I have the same issue. Is it solved now ?

@lordfiSh
Copy link

same problem, so no

@DarienFord
Copy link

The issue lies with lines 69-71 in what appears to be some addition for multiple data stores.
https://github.com/node-red/node-red/blob/28b311b7ed37a8bd4c00268b56fd5972a31bc602/red/api/admin/context.js#L69-L71

I commented out those lines in my own docker image of node red and things are now working for me.

@kevinduong
Copy link

Here's a workaround for those of you who need one for now:
#41

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

10 participants