node-red-contrib-home-assistant-websocket: Get Entities node is extremely slow and cause Home assiatnt to disconnect

Describe the bug

A simple query with a single entity, takes 2 seconds, while a more complex one with multiple queries or using an “in group” takes up to 10 seconds and causing connectivity issues and tons of Home assistant Disconnects. I rolled back to .65 and these queries are instant. Not sure exactly what version this started at, but my guess is that this is what is causing the majority of the issues that are listed on GitHub (ie disconnect, crashes etc)

To Reproduce

a simple flow as outlined in the screenshot

Expected behavior

In older version (.65 tested) this was instant

Screenshots

image

Example Flow

[
    {
        "id": "dfd6fc951c155ad8",
        "type": "tab",
        "label": "Flow 1",
        "disabled": false,
        "info": "",
        "env": []
    },
    {
        "id": "70151ef02612fa4f",
        "type": "inject",
        "z": "dfd6fc951c155ad8",
        "name": "",
        "props": [
            {
                "p": "payload"
            },
            {
                "p": "topic",
                "vt": "str"
            }
        ],
        "repeat": "",
        "crontab": "",
        "once": false,
        "onceDelay": 0.1,
        "topic": "",
        "payload": "",
        "payloadType": "date",
        "x": 280,
        "y": 380,
        "wires": [
            [
                "1f31c4b6275e9762"
            ]
        ]
    },
    {
        "id": "1f31c4b6275e9762",
        "type": "ha-get-entities",
        "z": "dfd6fc951c155ad8",
        "name": "",
        "server": "5ea56d96.083004",
        "version": 1,
        "rules": [
            {
                "condition": "state_object",
                "property": "entity_id",
                "logic": "is",
                "value": "device_tracker.unifi_default_00_50_56_9f_bc_22",
                "valueType": "str"
            }
        ],
        "outputType": "array",
        "outputEmptyResults": false,
        "outputLocationType": "msg",
        "outputLocation": "payload",
        "outputResultsCount": 1,
        "x": 630,
        "y": 380,
        "wires": [
            [
                "19dab93174b6898f"
            ]
        ]
    },
    {
        "id": "19dab93174b6898f",
        "type": "debug",
        "z": "dfd6fc951c155ad8",
        "name": "debug 1",
        "active": true,
        "tosidebar": true,
        "console": false,
        "tostatus": false,
        "complete": "false",
        "statusVal": "",
        "statusType": "auto",
        "x": 960,
        "y": 380,
        "wires": []
    },
    {
        "id": "5ea56d96.083004",
        "type": "server",
        "name": "Home Assistant",
        "addon": true
    }
]

Environment Information

The button not in my nodered isnat and there is no way to download the diagnostic flow from your https://zachowj.github.io/node-red-contrib-home-assistant-websocket/guide/diagnostics.html#overview

Additional context

No response

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Comments: 15 (5 by maintainers)

Most upvoted comments

The latest release, 0.75.0, includes significant speed improvements for the get-entities node.

seems to be related, but I just noticed that action nodes with action on todo.get_items is super slow and sometimes cause nodered to crash as well.

image