zachowj / hass-node-red

Companion Component for node-red-contrib-home-assistant-websocket to help integrate Node-RED with Home Assistant Core
MIT License
477 stars 185 forks source link

Energy entities stopped working in the Energy panel with version 4.01 #288

Closed driagi closed 1 month ago

driagi commented 3 months ago

Describe the bug

After updating to version 4.0.1, the Energy panel stopped working (undefined entity) My configuration: Node-Red Companion: 4.01 Core: 2024.7.2 Supervisor: 2024.06.2 Operating System: 12.4

To Reproduce

  1. Create a energy entity
  2. Add Entity to Energy panel

Expected behavior

No response

Screenshots

image image image

Example Flow

No response

Environment Information

Version: 0.65.1

Home Assistant version: 2024.7.2 Companion version: 4.0.1

Node-RED version: 4.0.2 Docker: yes Add-on: no

Node.js version: v18.20.3 arm64 linux OS: Linux 6.6.31-haos-raspi arm64

Additional context

No response

driagi commented 3 months ago

Is there something wrong with the issue?

zachowj commented 3 months ago

What does the state for those two entities show in the developers tools in HA?

driagi commented 3 months ago

They don't exist, but I think they've changed names. For example: from sensor.nr_consumo_totale_2 to sensor.consumo_totale it seems to have changed to the Friendly name

image

image

image

driagi commented 3 months ago

Yes, I tested it and confirm that it takes the form sensor.friendlyname

image

image

zachowj commented 3 months ago

The first time you create an entity from NR it will attempt to create an entity ID from the friendly name field. If the friendly name field is blank the entity id will default to sensor.nodered_<node id >. After the entity has been created in HA for the first time, the friendly name field controls only the friendly name in HA. It will not change the entity ID field. That has to be done through HA.

driagi commented 3 months ago

But the entity name changed on day 7 after the update (4.0.1 Comapanion version). I didn't create or change anything, i in fact the energy panel worked well for months until day 7

PaviAN31 commented 2 months ago

I have Node-RED version 4.0.2 and I solved reading via API from SolarX in the following way:

  1. API call every 2 minutes. (max. API is 10 queries per 1 min)
  2. Querying the API with the "http request" block
  3. transfer of individual data from the API to specific devices in HA via the "sensor" block - each value in a separate block

This solution works very well, I did it about a week ago and I don't have any problems with it so far, all values ​​are transferred correctly, except that HA shows data at 5-minute intervals, so I think that it would be possible to easily reduce API polling to 1x every 4- 5 min. The green "debug" blocks are only for testing in case of read failure

obraz obraz obraz obraz obraz obraz obraz obraz obraz obraz

driagi commented 1 month ago

Solved by renaming the entity