#How to get the "actual value" of entities?

1 messages · Page 1 of 1 (latest)

quiet vortex
#

I have an Zigbee controller, and I have zigbee2mqtt running and all, everything works, splendid.
In zigbee2mqtt, it displays the state of a device as follow:

{
    "battery": 100,
    "battery_low": false,
    "linkquality": 90,
    "tamper": false,
    "water_leak": true
}

In HA, it shows like this: (see image)

I applied a label on this, and I'm regrouping it using a helper. When I'm trying to configure set helper, where do I get the actual value of the state?
Where is the conversion from "water_leak == true" to "Moisture == Wet" happens?

sly cave
#

The actual state can be found at developer tools > states

#

The conversion you're seeing is just for the frontend and is determined by the device class

quiet vortex
#

Ok, so in there, I would need to read it as:
zigbee2mqtt says it's a binary sensor, so it's not true/false like reported, but "on/off" in HA.
From there, because the device_class says moisture, it's "Wet/Dry" for the frontend
is that more or less it?

#

(and in my scripts, I'd need to use on/off)

sly cave
#

Yep, that's right

quiet vortex
#

Great, thanks! I wish there was a "view system things" from the entity screen.

#

(but I'll manage, it's not a super PITA)

sly cave
#

No prob. What do you mean?

#

Oh nvm I think I get what you mean

quiet vortex
#

😄

#

Thanks again