Need python help getting the state of another entity

I’m experimenting with writing a simple entity that grabs the state of another entity. As an experiment I’ve started by modifying the generic temperature sensor to pull the temperature value out of the state of my heatpump entity. However, the code I’m currently testing returns None as the state value. See line 72 of the code posted here:

and the logs returned:

2018-03-11 04:05:23 WARNING (MainThread) [custom_components.sensor.heatpump_temp] hp name: climate.1st_fl_heatpump, state: None
2018-03-11 04:05:24 ERROR (MainThread) [homeassistant.components.sensor] Error on device update!
Traceback (most recent call last):
  File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/helpers/", line 217, in async_add_entity
    yield from entity.async_device_update(warning=False)
  File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/helpers/", line 304, in async_device_update
    yield from self.async_update()
  File "/usr/lib/python3.5/asyncio/", line 210, in coro
    res = func(*args, **kw)
  File "/home/homeassistant/.homeassistant/custom_components/sensor/", line 75, in async_update
    self._state = heatpump_states.attributes.get('current_temperature')
AttributeError: 'NoneType' object has no attribute 'attributes'

From the logs, when I try to output what I would hope would be a state object, I get None, then error out when I try to look for attributes in a None.
I’ve verified by cut and paste that climate.1st_fl_heatpump is an entity in my States > Entities page of HA.

Still having problems, and it gets a little weirder. I have a bunch of entities that show up in my States window on HA. However when add the line:

_LOGGER.warning('all states: {0}'.format(self._hass.states.async_entity_ids() ))

I only see:

all states: ['sun.sun', 'group.kids_rooms']

Why doesn’t the hass.states object that I’m querying seem to contain all the states that my HA seems to have?