Python reading between the lines

I know this if i have this in a yaml file

entity_id: climate.gas_heater

and do this

ENTITY_ID = data.get("entity_id", None)

ENTITY_ID has the data I want :slight_smile:

so by doing this

state_climate = hass.states.get(ENTITY_ID)

state_climate has the state in it

so

current_temperature = state_climate.attributes.get("current_temperature")
temperature = state_climate.attributes.get("temperature")

and I have the data I want

BUT NOW the question

how do i read the heater item from the object

i have

  - platform: generic_thermostat
    name: "Gas Heater"
    heater:  switch.gas_heater   ##### <-- read this
    target_sensor: sensor.lounge_temperature
    min_temp: 15
    max_temp: 30
    ac_mode: False
    target_temp: 20.8
    initial_hvac_mode: "off"
    cold_tolerance: 0.1
    hot_tolerance: 0.1
    away_temp: 16

That’s not an ‘object’, it’s the configuration information to create what will become an object (an entity). Not all of that configuration information is included in an entity’s attributes. For example, platform is never included.

Check climate.gas_heater in Developer Tools > States. What you see listed in Attributes is what’s accessible.

thanks @123

didnt think of looking in state page

bugger can’t see it

must be somewhere its in the config looks like more reading