Node-red-contrib-home-assistant-websocket

Can someone explain to me why the first sequence works fine (it reports that the alarm is on, which is correct), but the second sequence currently does not. It used to work. The third one does.

In the second example (I do a single button click to trigger this) the current-state node is called when the payload/topic is already filled from the (xiaomi_aqara.click) event, leading incorrectly to payload ‘off’. It does work in the 3rd example (I do a double click to trigger this) when I first clear the entire payload. But I would like to prevent that step.

Overriding the topic in the current state node does not seem to make a difference.
I’m using NR v 0.20.2 and this modules version 0.12.2 (latest)

Take a look at the release notes for v0.11.0 https://github.com/zachowj/node-red-contrib-home-assistant-websocket/releases/tag/v0.11.0

Starting with v0.12.0 there is now the ability to block input overrides in a current-state node.

1 Like

Hi!

I’m having trouble installing latest version v 0.12.2 on a docker running node-red v0.20.5.
I have tried a clean install but as soon as I install this module and restart docker it crashes upon start with this output:

node-red2 | 2 Jun 21:30:52 - [info] Node-RED version: v0.20.5
node-red2 | 2 Jun 21:30:52 - [info] Node.js version: v8.15.1
node-red2 | 2 Jun 21:30:52 - [info] Linux 4.18.0-20-generic x64 LE
node-red2 | 2 Jun 21:30:52 - [info] Loading palette nodes
node-red2 | 2 Jun 21:30:53 - [warn] rpi-gpio : Raspberry Pi specific node set inactive
node-red2 | 2 Jun 21:30:53 - [warn] rpi-gpio : Cannot find Pi RPi.GPIO python library
node-red2 | Segmentation fault (core dumped)
node-red2 | npm ERR! code ELIFECYCLE
node-red2 | npm ERR! errno 139
node-red2 | npm ERR! [email protected] start: node $NODE_OPTIONS node_modules/node-red/red.js -v $FLOWS "--userDir" "/data"
node-red2 | npm ERR! Exit status 139
node-red2 | npm ERR!
node-red2 | npm ERR! Failed at the [email protected] start script.
node-red2 | npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
node-red2 |
node-red2 | npm ERR! A complete log of this run can be found in:
node-red2 | npm ERR! /root/.npm/_logs/2019-06-02T19_30_54_258Z-debug.log
node-red2 |
node-red2 | > [email protected] start /usr/src/node-red
node-red2 | > node $NODE_OPTIONS node_modules/node-red/red.js -v $FLOWS “–userDir” “/data”

Never mind, it was not this module causing the crash but another bluetooth module :slight_smile:

I can not seem to upgrade to v0.12.0

In node red I click upgrade, it downloads and then says a restart is needed. After a restart I’m still on version 0.12.0

Tried several times. All other nodes upgrade fine.

I’m assuming you mean to v0.12.2. What happens if you try via the command line?

Yes. Sorry I did mean v0.12.2 and yes updating via the command line worked. thank you

I use input booleans to stop my automations from HA ui. After the update the input boolean is sending it’s state instead of sending the original payload of the sensor. Already tried checking the override topic and the block input overrides.

How can i fix this?

Update to the newly released 12.3.

I can’t seem to get the Wait Until to work the way I thought it would. I am trying to wait until the vacuum changes to “returning” to go to the next part of the flow. Am I missing something in property or Entity Location?

image

This is what it looks like when debugging state changes on the vacuum

image

Wait-until nodes needs to know what property of the entity to check against. Set the property field to state.

I was wondering what property was referring to, that worked! Thanks for the great work on this!

Just a little question. Am I overlooking something or can’t you change the value to integer in the data field using the code below?

{
    "level": "{{ states.input_number.purifier_level | int }}"
}

I’m trying to use this with xiaomi_miio_set_favorite_level.

If you’re talking about the data field within a call-service no you can’t use a template to create a number because the data field needs to be a valid JSON string.

{
    "level": {{ states.input_number.purifier_level}}
}

The above isn’t a valid JSON string.

You could pass in the data value from a function node before the call-service node.

const states = global.get('homeassistant').homeAssistant.states;
msg.payload = {
  data: {
      level: states['input_number.purifier_level'].state
    }
};
return msg;
1 Like

Hi Kermit, I managed to fix it in a different way.

I’m now using a Get template node to convert the value to int:
{{ states['input_number.purifier_level'].state | int }}

The reason is that input_number uses decimals, which xiaomi_miio_set_favorite_level doesn’t expect.

After that I’m using the payload in the Call service data field:

{
    "level": "{{payload}}"
} 

Thanks for helping out!

Hello, I just updated to the latest version and all of my Home assistant nodes have changed to “unknown” . Here is a screen shot of the pallette:

Could you please advise on how I can fix this?

Thanks for your help!

Are you using docker on a rpi? If so you need to upgrade node.js

https://github.com/zachowj/node-red-contrib-home-assistant-websocket/issues/127#issuecomment-500345381

Thanks @Kermit! Took me a little to figure out, but I got it working!

I have NR running on ubuntu server in docker and after upgrade to latest node-red-contrib-home-assistant-websocket and latest nodered/node-red-docker image, beside error above (I had to update all nodes in flows :frowning: ), I am also facing very high load on this docker container. I tried to run new container and after I add few hass nodes to flow, it starts to eat cpu also. Anyone facing this issue?

Also since upgrade, I am facing very slow response in browser page with node-red and high cpu usage on this machine (not hosting node-red). This is pain, I don’t know what to do with this cpu usage(s). Any suggestion would be welcome :slight_smile: