Difference between entity state in lovelace and developer tool state

I’m using node red to control my solar panels and setting among of parameters like charge battery. To verify that the settings are accepted by the inverter there is a function to ask status. In this case node red ask status from the inverter via modbus.The inverter replays correctly to node red. Now the problem: I have created a entity in node red for the inverter state. This entity is presented in my lovelace but will not update its state. If a check with the entity status in developer tools state I can see that the entity is immediately updated there.
In developer tool state:
driftlage_inverter|Maximise self consumption
driftlage_inverter2|Maximise self consumption

and in lovelace the state is ‘Time Of Use’ for both entities.

The problem seems not to be related to node red since it is the correct state in developer tool.
Any suggestions of what’s wrong?

can you maybe share more information and if possible some screenshots?
Also, please share how the configuration in node red is done…

Lovelace might change the displayed state - depending on device_class, or other information that might be assigned to the sensor itself.

Example:
Binary Sensors are usually “on / off” - in the developer tools.
But based on the Device_class (door, window, … ) the states will be shown as “open / closed”, “charging, not charging”, “locked, unlocked”, etc.

It would be helpful to see how it is actually displayed in lovelace - it might also depend on the card you have used, since different cards might display the same values slightly different.




Here’s some screenshot. I have tested with custom button card and entity card. In node red I’ve setted the entity nod to device class sensor.

ok, so basically, you define the payload for the sensor in an if/else structure in nodered…

Based on this, it seems, that within the Developer Tools (in Homeassistant), the expected msg.payload should be “4” but in the dashboard, it is showing the value from “6” - right?

What does the history of this sensor shows?

Would it be possible (for testing) - to add sensors that just output the payload directly (1, 2, 3, 4, and so on) to see, how these do behave and if this does match the displayed information?

also, you should consider to add a “else” - without any other if - that would be come true if none of your other “if” does match

if "1"
else if "2"
else if "3"
else

Thank you for your replies. I will test the things you suggested. Actually it is the right value in developer tool and wrong in my lovelace configuration.
/Anders