Can't get any "homeassistant" sensors/binary_sensors/time working on ESP8266

It’s one of my ESPHome devices if that’s what you mean…

So when I try the temp sensor as a sensor:

sensor:
  - platform: homeassistant
    id: attic_temp
    entity_id: sensor.dennis_office_sensor_motion_temperature
    internal: true

With this print:
it.printf(70, 100, id(font_date), "%2.1f", id(attic_temp).state);

I get nan on the display like it’s not a number. But then a few seconds later it shows the actual temperature number! So I think I’m finally getting somewhere with your help.

It’s very much appreciated!

Yes, that is what I meant. Couldn’t think of the specific terminology off the top of my head.

Glad you’ve made some progress and got some values showing.

OMG found the motherload of posts on this thread:

I know all my answers are in there somewhere! I’m still trying to read the state of a lamp, and in addition I’d like to read an attribute like brightness

1 Like

I’m still fiddling around with different displays and ESP devices and have come across something else I hope someone has an answer for.

None of the “home assistant” links work, time, sensor, text_sensor, etc.

The code is copied straight from another working device, so I think it has something to do with the board type / platform / etc.

esp8266:
  board: nodemcuv2
#  board: esp12e
#  framework:
#   type: arduino

I have to use nodemcuv2 because the other one throws an error that it doesn’t know what pins D1 and D2 are, as defined here:

i2c:
  sda: D1
  scl: D2

My board is described as HiLetgo 3pcs ESP8266 NodeMCU CP2102 ESP-12E which to me tells me I should use a board selection with 12E in it, and the only two are shown above.

Also, I don’t know if it has something to do with the framework section, but my successful attempts above with the Atom S3 unit has this in it’s config:

esp32:
  board: esp32-s3-devkitc-1
  framework:
    type: arduino

But the two boards I am trying to use say that the framework is an unknown setting.

Anyway, the display is working but the time is wrong and my temp sensor says “nan” like it doesn’t have any data from HA.

Also my text_sensor which works on the other board is not pulling data from the HA sensor.

Hmm – any chance it has something to do with the API encryption key?

I don’t know how that part works so I’ll research that. Maybe something has to be set up in HA to allow communications of sensors, etc.

OMG figured it out – it was the key. I changed it to a regular plaintext password and then the device ended up showing up under integrations as a new device, so I re-added it back in and the device can now talk to HA and gather sensor data, which is working now.

1 Like