Hi - thanks for the link, although I rather thought the GitHub page was more for reporting issues rather than general ‘how do I get this working’ requests for support?
However, I think I have since realised that rpi_gpio integration is not what I need - it seems to support only binary sensors, whereas my BH1750 light sensor is an analogue device. That being the case, I think I can add myself to the group of HomeAssistant users, angry at the deprecation of GPIO without an adequate alternative (it’s a bit like Ford Motor Co. suddenly deciding all their new models will ship without engines installed!)
The custom integration that is linked there is the one that home assistant is deprecating. It’s the exact same code. If the custom integration doesn’t work for you, then the build-in deprecated integration wouldn’t have worked either. I.e. There’s no reason to be upset as it wouldn’t have worked for you anyways.
I was under the impression that the new rpi_gpio integration only provided for binary_sensor, whereas my BH1750 is a ‘sensor’?
I tried ESPHome but started to realise that you need the BH1750 connect to some kind of ESP32 board (not sure if I’ve understood correctly) whereas my BH1750 is wired directly to the GPIO pins on my rpi2b as shown here:
Now I’ve upgraded HomeAssistant to the latest version (with the deprecated GPIO functionality), I’ve installed the rpi_gpio custom integration, and “platform: bh1750” now results in a failed configuration.yaml check.
So how do I get HomeAssistant to recognise “platform: bh1750” using the new rpi_gpio integration? What am I not understanding?
just to let you know, it’s going to warn you about it’s removal in the logs. You can just ignore that or remove lines 77 to 82 in sensor.py. Basically, this chunk
_LOGGER.warning(
"The BH1750 integration is deprecated and will be removed "
"in Home Assistant Core 2022.4; this integration is removed under "
"Architectural Decision Record 0019, more information can be found here: "
"https://github.com/home-assistant/architecture/blob/d1639d2c8b1ac697aa95d2177d1db2cac0cf2f97/adr/0019-GPIO.md"
)
I’ve now got my BH1750 sensor working in the latest Home Assistant & it’s doing exactly what I needed. I did have to mess around a bit with ‘HassOS i2c Configurator’ AddOn before I got it working, but it’s working fine now - thank you for your help.
I agree and am also very unhappy with de removal of RP_GPIO and DHT, Seems we users are guilty on not activating reporting our system to the developers so they think the integration is not used. I made a downgrade but this is not the solution. This is my first contribution ever. greetings
Closing this thread and locking it to keep Grahams post at the bottom. If you’d like to discuss the removal of GPIO, please create a new thread. I have to do this because Social topics do not have a solution checkbox and this gives people searching for the replacement a place to look.
Please use the library linked by @Graham1 in the previous post.