Pyscript: Get hvac_mode?

I’m at my wits end here! I’m trying to get the current hvac mode for my nest thermostat, using:

state.get(“climate.hallway.hvac_mode”)

However it’s spitting out the following error:

state.get(“climate.hallway.hvac_mode”) ^ AttributeError: state ‘climate.hallway’ has no attribute ‘hvac_mode’

According to the documentation, hvac_mode should be the correct attribute. Am I missing something here?

Edit: I can set the temperature through pyscript, and I can see/change everything through the card, including the hvac mode. Just can’t find how to access that information through pyscript.

Shouldn’t you be using state.getattr()

No, this is a valid way to get an attribute value. state.getattr() returns the whole dictionary.

Upon further investigation, all the other attributes are available, but “hvac_mode” is simply not there.

Interesting. It’s not an attribute. This does the trick. :rofl:

state.get(“climate.hallway”)