node-red-contrib-home-assistant icon indicating copy to clipboard operation
node-red-contrib-home-assistant copied to clipboard

TypeError: Cannot read property 'state' of null

Open FezVrasta opened this issue 7 years ago • 4 comments

Describe the bug I get an error, apparently randomly, when I use the "server-state-changed" node.

31/07/2018, 20:07:50node: clean guestsroom
msg : error
"TypeError: Cannot read property 'state' of null"

If I click on the error it points to the server-state-changed node, it happens with any node of this type I have in my flows.

To Reproduce Steps to reproduce the behavior:

  1. Use a server-state-changed node in any flow

Expected behavior No errors

Environment (please complete the following information):

  • Node Red Version: 0.18.7
  • NR Home Assistant Plugin Version: 0.3.2
  • Is Node Red running in Docker: No

Other (please complete the following information):

  • Have you searched previous issues for duplicates?: yes
  • Did you attempt to reproduce the issue in the dev docker environment, if so what were results (See README.md): n/a

FezVrasta avatar Jul 31 '18 18:07 FezVrasta

You might look at Spartan's 117 fork here, which has a fix for this:

https://github.com/Spartan-II-117/node-red-contrib-home-assistant

The original maintainer here seems to be AWOL.

walthowd avatar Jul 31 '18 20:07 walthowd

Thanks for the reply! How do I install the fork? Can I find it in the Node-RED palette manager, npm or do I have to install it manually?

FezVrasta avatar Aug 01 '18 06:08 FezVrasta

It's not published to NPM yet so you would need to install it manually. You can look through this thread on reddit if you get stuck:

https://www.reddit.com/r/homeassistant/comments/8xyrfe/node_red_just_wanted_to_share_a_great_fork_i_found/

walthowd avatar Aug 01 '18 15:08 walthowd

@FezVrasta Please don't follow my old install method though, it leads to problems. You should do it this way instead: https://www.reddit.com/r/homeassistant/comments/8xyrfe/node_red_just_wanted_to_share_a_great_fork_i_found/e3y0qqu/

chimpy avatar Aug 10 '18 12:08 chimpy