Current State node - attributes

OUTPUTTING THE ATTRIBUTE STATE FROM THE NODE

To output the attribute state rather than the entity state
If State JASONata J: ($entity().attributes.temperature) = 21
State Type string
Output properties
msg.payload J: ($entity().attributes.temperature)

Behaviour:

  • The Node displays the state of the string, as the climate entities state is a string, showing heat, cool, dry, etc.
    • NOTE: This does not control the output of the node with the JSONata being in in place
  • The colour indicator indicates Green for ‘true’ and Red for ‘false’ against the attribute in the JSONata expression.
  • The messages are directed to the right output
  • msg.payload = the state of the attribute.
    image

GREAT INFORMATION ON THIS SITE Never Realised it was there.
More Info node-red-contrib-home-assistant-websocket
More Info on JSONata in JSONata
Use of Mustache Template Mustache Templates
node-red-contrib-home-assistant-websocket Cookbook