Custom sensor isn't appearing

I want to create a custom sensor to return the local lake water level by using a USGS web service so I can have a graph in lovelace. I found these instructions:
example-custom-config/custom_components/example_sensor at master · home-assistant/example-custom-config · GitHub

Initially I tried to change my sensor domain, name, etc. but it didn’t show up in home assistant’s developer tools page. I then tried the unmodified example_sensor and that appeared to work. Except I shortly after realized that was present regardless (with a different fixed value of 73). So it appears that neither of my attempts at a starter custom sensor actually got loaded.

I have them located in my home assistant config directory under custom_components - each in their own sub directory. I added them to my configuration.yaml:

sensor:
  - platform: custom_sensor

As far as I can see I did everything that example said to do but nothing shows up. The only difference is I have the extra dash vs the example readme but that’s looks to be just a mistake in the docs.

What might I be missing? I’m not getting any errors starting home assistant (unless I try to remove that dash). I’m stumped.

Did you restart HA after adding the yaml?

Yes, many times.

I do see a __pycache__ directory getting created so something is happening (and only if the sensor is listed in the configuration yaml) but the sensor never gets listed in the dev configuration list of sensors.

Where did you exactly create the sensors? And do you get any errors before “checking configuration”?

I have home assistant running in docker with the config directory at ~pi/.homeassistant. I created the custom_components directory here.

Found a reference to the new custom sensor in the logs, but no errors related to it:

Logger: homeassistant.loader
Source: loader.py:440
First occurred: 12:24:41 AM (1 occurrences)
Last logged: 12:24:41 AM

You are using a custom integration for lake_XXX which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant.

I don’t see a ‘checking configuration’ log entry anywhere.

Well that’s odd. I’d copied back over the sample python pver my modifications to start from scratch to try to get the sensor to appear and while I’d then re-updated the domain in the manifest.json file, the sensor.py was unchanged from the sample - so it still returned ‘Example Temperature’ when the sensor was asked for it’s name (via the name property). I fixed just that and suddenly the sensor switched from being sensor.example_temperature to being the expected sensor.lake_xxx despite me making no modifications to the domain, which was already lake_xxx. At this point I basically have what I had originally (where I had changed that name) but it’s now showing up as an entity as expected. From experimentation the entity id is derived from that name and the domain is unrelated.

So I don’t know what I had wrong in my first attempts but I’m unblocked now.

I also cleared up my confusion around the different value I was seeing for it’s state. I was seeing 73 but the sensor sample has 23. But that’s because my home assistant is set to Fahrenheit and the example sensor returns Celsius. Obvious in hindsight.