Code Monkey home page Code Monkey logo

Comments (6)

accyroy avatar accyroy commented on May 30, 2024 1

Just for info for anyone else getting this error, it is caused by running an older version of node_js. When I installed everything on ubuntu 16, I followed the instructions here: https://tecadmin.net/install-latest-nodejs-npm-on-ubuntu/ to install version 8 of nodejs, then re-installed nodered and this module and everything works fine now.

from node-red-contrib-home-assistant.

AYapejian avatar AYapejian commented on May 30, 2024

This looks like it could be due to data you're passing into the API node. Maybe I can improve / add validity checks if they aren't there already. Could you provide some more details on how the flow was configured within node-red?

from node-red-contrib-home-assistant.

trantoriana avatar trantoriana commented on May 30, 2024

This seems to be the underlying issue:

26 Nov 21:01:12 - [info] Waiting for missing types to be registered:
26 Nov 21:01:12 - [info] - server
26 Nov 21:01:12 - [info] - api-call-service

I have installed the addon in node-red, and upon refreshing the page I get exactly the same types to be missing. Deployment fails after that.

If I then reboot node-red (as instructed) none of the addon types are available anymore. They are available in the addons page, so it is installed. But the nodes are not available from the workflow pallet nor are the recognized once embedded in a flow already.

Perhaps something is missing from the latest release ?

from node-red-contrib-home-assistant.

RobvanHamersveld avatar RobvanHamersveld commented on May 30, 2024

I've installed node-red today and have the same issue. After installing node-red I installed node-red-contrib-home-assistant and after starting node-red I got the following output;

3 Jan 17:11:51 - [info] Node.js  version: v4.7.2
3 Jan 17:11:51 - [info] Linux 4.10.0-42-generic x64 LE
3 Jan 17:11:51 - [info] Loading palette nodes
3 Jan 17:11:52 - [warn] ------------------------------------------------------
3 Jan 17:11:52 - [warn] [rpi-gpio] Info : Ignoring Raspberry Pi specific node
3 Jan 17:11:52 - [warn] [api-call-service] SyntaxError: Unexpected token = (line:3)
3 Jan 17:11:52 - [warn] [api-current-state] SyntaxError: Unexpected token {
3 Jan 17:11:52 - [warn] [api-get-history] SyntaxError: Unexpected token = (line:2)
3 Jan 17:11:52 - [warn] [api-render-template] SyntaxError: Unexpected token = (line:2)
3 Jan 17:11:52 - [warn] [server] SyntaxError: Unexpected token =
3 Jan 17:11:52 - [warn] [server-events] SyntaxError: Unexpected token = (line:2)
3 Jan 17:11:52 - [warn] [server-state-changed] SyntaxError: Unexpected token {
3 Jan 17:11:52 - [warn] ------------------------------------------------------
3 Jan 17:11:52 - [info] Settings file  : /home/node-red/.node-red/settings.js
3 Jan 17:11:52 - [info] User directory : /home/node-red/.node-red
3 Jan 17:11:52 - [info] Flows file     : /home/node-red/.node-red/flows_HASS01.json
3 Jan 17:11:52 - [info] Creating new flow file
3 Jan 17:11:52 - [info] Starting flows
3 Jan 17:11:52 - [info] Started flows
3 Jan 17:11:52 - [info] Server now running at http://127.0.0.1:1880/

When I insert a Home Assistant node in the flow an configure the server I get an error in the webinterface Cannot GET /homeassistant/entities.

In node-red I see:

3 Jan 17:13:46 - [info] Installed module: node-red-contrib-home-assistant
3 Jan 17:13:46 - [info] Added node types:
3 Jan 17:13:46 - [info]  - node-red-contrib-home-assistant:api-call-service : SyntaxError: Unexpected token = (line:3)
3 Jan 17:13:46 - [info]  - node-red-contrib-home-assistant:api-current-state : SyntaxError: Unexpected token {
3 Jan 17:13:46 - [info]  - node-red-contrib-home-assistant:api-get-history : SyntaxError: Unexpected token = (line:2)
3 Jan 17:13:46 - [info]  - node-red-contrib-home-assistant:api-render-template : SyntaxError: Unexpected token = (line:2)
3 Jan 17:13:46 - [info]  - node-red-contrib-home-assistant:server : SyntaxError: Unexpected token =
3 Jan 17:13:46 - [info]  - node-red-contrib-home-assistant:server-events : SyntaxError: Unexpected token = (line:2)
3 Jan 17:13:46 - [info]  - node-red-contrib-home-assistant:server-state-changed : SyntaxError: Unexpected token {

And after trying to deploy the flow;

3 Jan 17:15:39 - [info] Stopped flows
3 Jan 17:15:39 - [info] Waiting for missing types to be registered:
3 Jan 17:15:39 - [info]  - server
3 Jan 17:15:39 - [info]  - server-state-changed

from node-red-contrib-home-assistant.

trantoriana avatar trantoriana commented on May 30, 2024

I migrated away from this addon to:

*) node-red-contrib-home-assistant-ws

no problems ever since.

from node-red-contrib-home-assistant.

AYapejian avatar AYapejian commented on May 30, 2024

I still can't reproduce this however I did release 0.2.1 today, only an NPE fix really however there is an automated dev/test environment that may prove useful here. Check the README.md on master if you're interested in giving it a go, details at the bottom. You'll need Docker and Docker Compose installed but after that should be a 1 command spin up of HA/Node Red all configured and working OOTB. If you can find steps to reproduce in that environment let me know and I'll troubleshoot. Going to close this for now, feel free to reference in a new issue with repro steps in the dev environment however and I'll check it out asap.

from node-red-contrib-home-assistant.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.