zachowj / node-red-contrib-home-assistant-websocket

Node-RED integration with Home Assistant
https://zachowj.github.io/node-red-contrib-home-assistant-websocket/
MIT License
487 stars 88 forks source link

Node-RED Home Assistant (pink) device node is loosing its trigger #634

Closed GLehnhoff closed 1 month ago

GLehnhoff commented 2 years ago

Documentation URL

No response

The problem

The Node-RED Home Assistant (pink) device node is loosing its trigger from time to time. I yet do not know when but will track. This is critical to me as I use it very often (even I know this is a Alpha version, which it is already a very long time). "Loosing" means, that it changes the Tricker to something else, mostly "Device offline".

Here a screen shot in case it is not clear of what node I am talking: Screenshot_20220509_132925 .

nylandsmarthome commented 2 years ago

I'm having a similar issue, but I think I have more details on how to recreate it.

I add the node and assign the device to it. I set the trigger to a "Central Scene" or event value notification, I'm trying to use the key pressed multiple times. Issue_1

When I press Done, the Value reverts to "KeyPressed" no matter what I set it to before. Issue_2

After Deploying when I reopen the node the trigger is gone and cannot be selected again. Issue_3

If I originally select just "KeyPressed" it works fine after deployment, the issue only happens if selecting a different value.

mattkrins commented 2 years ago

Getting the same issue. Only started happening with the latest batch of updates.

Jenematalia commented 2 years ago

Same thing is happening to me. Completely crippled my Lutron Aurora Dimmer Dials. Just started happening last night

Jenematalia commented 2 years ago

Also while setting up a new Device Node, if I find an entity that still has triggers available and I choose that entity's trigger option and then switch to a different entity that doesn't seem to be working, the previous entity's trigger options are shown as options rather than what used to work, i.e. choosing Bathroom Dimmer as a device first (with no trigger options available), choosing something like diyHue as a device with a trigger for 'recently updated' or something, then switching back to the Bathroom Dimmer gives me triggers for 'recently updated' or whatever the previous trigger options were rather than 'initial press' or 'long press', etc. options that used to be the case

Jenematalia commented 2 years ago

Checked the Automations tab on Home Assistant itself, and it seems that HA itself has lost the ability to see device triggers entirely. Not sure what to do here. Everything I have set up is completely crippled at this point

mattkrins commented 2 years ago

Checked the Automations tab on Home Assistant itself, and it seems that HA itself has lost the ability to see device triggers entirely. Not sure what to do here. Everything I have set up is completely crippled at this point

I have made a work-around by setting up triggers manually in a new flow. For example: image

Here is a node export with how i am handling it: [{"id":"6b52cdb3c2a257bd","type":"server-events","z":"3c209a847e02b373","name":"deCONZ Event","server":"1e40c50d.c1e02b","version":1,"event_type":"deconz_event","exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"waitForRunning":true,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"eventData"},{"property":"event_type","propertyType":"msg","value":"$outputData(\"eventData\").event_type","valueType":"jsonata"}],"x":120,"y":120,"wires":[["cd0dbca7b31fd311"]]},{"id":"cd0dbca7b31fd311","type":"switch","z":"3c209a847e02b373","name":"","property":"payload.event.id","propertyType":"msg","rules":[{"t":"eq","v":"doorbell","vt":"str"},{"t":"eq","v":"bedroom_dimmer","vt":"str"}],"checkall":"true","repair":false,"outputs":2,"x":235,"y":120,"wires":[["bd3a483084dd25ef"],["b45166f80c3d56fe"]],"l":false},{"id":"bd3a483084dd25ef","type":"switch","z":"3c209a847e02b373","name":"Doorbell","property":"payload.event.event","propertyType":"msg","rules":[{"t":"eq","v":"1000","vt":"str"},{"t":"eq","v":"1005","vt":"str"}],"checkall":"true","repair":false,"outputs":2,"x":360,"y":120,"wires":[["e080b7e1fc5c144c"],["635ea0ec85fd4ea9"]]},{"id":"e080b7e1fc5c144c","type":"link out","z":"3c209a847e02b373","name":"Click","mode":"link","links":["eb51d1e6d858e982"],"x":505,"y":100,"wires":[]},{"id":"635ea0ec85fd4ea9","type":"link out","z":"3c209a847e02b373","name":"Tripple Click","mode":"link","links":["6671a84c2130c34a"],"x":505,"y":140,"wires":[]},{"id":"b45166f80c3d56fe","type":"switch","z":"3c209a847e02b373","name":"Bedroom Remote","property":"payload.event.event","propertyType":"msg","rules":[{"t":"eq","v":"1000","vt":"str"},{"t":"eq","v":"4000","vt":"str"},{"t":"eq","v":"4003","vt":"str"}],"checkall":"true","repair":false,"outputs":3,"x":390,"y":200,"wires":[[],[],[]]},{"id":"1e40c50d.c1e02b","type":"server","name":"Home Assistant","version":2,"addon":true,"rejectUnauthorizedCerts":true,"ha_boolean":"y|yes|true|on|home|open","connectionDelay":true,"cacheJson":true,"heartbeat":false,"heartbeatInterval":30}]

Jenematalia commented 2 years ago

Did some digging and it turns out my add-on for VS was just having a hiccup or something. I'd open up the web UI and nothing would be displayed in the config folder at all. Tried restoring from a backup, did nothing to mediate. Uninstalled VS and reinstalled, fixed everything for some reason. Could view everything in config folder again. Super weird.

alexruffell commented 2 years ago

I am having the same issue as @nylandsmarthome. I am trying to use the device node to capture scenes but it won't same the number of key presses. On another note, it would be better (for flexibility and tidiness of flows) if the device node were also capable of outputting all scenes 001/002 and all key presses for the chosen endpoint instead of forcing the selection within the node itself.

I'd like to replace the zwave_js_value_notification node and the change node that looks for the specific node_id with the device node so that I don't have to come back to update the node id here in case it were to change (add/remove device, rare but it happens, trying to make things more future proof).

image
vipseixas commented 2 years ago

Still happening with plugin version 13.3.1. I stopped using this node and changed it all to "events: state" nodes.

Xeevis commented 1 year ago

Device node is really acting up for buttons especially after switching from ZHA to Zigbee2MQTT, trigger has to happen first before it starts registering. And not just to set it in NR, but also to trigger it and this will reset with each Home Assistant reboot. Found out the hard way with 6-gang doorbell that would sometimes ring sometimes not (single, double, tripple, hold) that is 24 combinations that would fail on first trigger. Switched over to MQTT node and everything is fine. Interestingly other types of entities like sensors work fine.

mcginnie commented 1 year ago

Another case where this doesn't seem to be working. Setup: Only Node-red flow present image New install as of 6/11/2022 using Node-Red Addon 13.5.1 in HAOS on Rpi 3 - everything up-to-date. HACS shows the Node-RED Companion v1.1.2 installed, and the dependency node-red-contrib-home-assistant-websocket is v 0.46.2 Should be catching a button press of a Sonoff Zigbee button SNZB-01.

image

There is no output for a button press event, while a simple HA automation reacts as expected.

image

jlittle988 commented 1 year ago

Bumping this, as I've just run into this issue as well. No matter what I select in Value for, it always reverts to KeyPressed when I click done.

MMachor commented 1 year ago

I have been running into the same issues. Appears to be directly related to rebooting HA. I have to make any change, even if it's a space at the end of the display name, to re-deploy it and then it works fine again. Right up until the next reboot. After that it's the same thing again.

GLehnhoff commented 11 months ago

Does not work anymore at all with Node-RED 3.x Will there be any work on that matter? If not, what is the workaround if I need the triggers of a hue button (short press, long press, ...)?

GLehnhoff commented 11 months ago

My Workaround

RaspberryMatic

RaspberryMatic delivers all values and triggers with the newest version. These values can be accessed with node events:state.

MQ2TT

At least with the Hue button an "action" is delivered which can be accessed by node events:state.

ZHA

Most complicated. No values delivered with the device which can be used by node events:status. Instead I had to use the events:all node with Event type "zha_event". Than I had to ask for the right device with the switch node by looking in msg.payload.event.device_ieee. After that I had to look with the switch node for the trigger in payload.event.command. In case of the hue button it is e.g. "on_short_release" or "on_long_release". Finding the right device_ieee and the values of the command/trigger must be done by a debug node.

Hue-Button with double click

If you double-click the Hue button, there will be send (among others) "on_short_release" and afterwards "on_double_press". If you have actions on both, you mus set a stoptime node of e.g. 1 second after the switch node. All outputs in questions have to go in the stoptimer. The stoptimer will deliver the last trigger (on_double_press) only.

Bildschirmfoto vom 2023-10-03 15-49-40