Further adventures in Home Assistant OrangePi GPIO

Its funny how a single sentence can change your course. In the last post about this work, I said: We also need to run hass as root,  because OrangePi GPIO support requires access to /dev/mem for reasons I haven’t dug into just yet. That's turned out to be (reasonably) a pretty big sticking point upstream. Access to /dev/mem gives you a whole bunch of access to the machine that Home Assistant probably shouldn't have. Alastair went off spelunking because he's more patient than me and found yet another OrangePi GPIO library. I think we're up to three or four of these at the moment, but this is the first one we've found which supports the sysfs interface to GPIO pins. That's exciting because it removes our run-as-root requirement. Its unexciting in that the sysfs interface has been deprecated by the kernel, but will remain supported for a while. I think people would be within their rights to conclude that the state of GPIO libraries for OrangePi is a bit of a dumpster fire right now. Anyways, the point of this post is mostly to write down how to use the sysfs interface to GPIO pins so that I can remember it later,…

Continue ReadingFurther adventures in Home Assistant OrangePi GPIO

Adventures in Home Assistant Raspberry Pi GPIO

Alastair D'Silva is running what looks to be a very well prepared home automation tutorial at LCA2019 based on Home Assistant. I offered to have a hack on the support for GPIO pins on OrangePi boards in Home Assistant because it sounded interesting for a vacation week. The only catch being that I'd never done anything with GPIO pins at all on either Raspberry Pi or Orange Pi. The first step seemed to be to get GPIO working at all on a Raspberry Pi (which is currently supported out of the box with Home Assistant). This online tutorial has a simple example of a circuit and the associated python code to blink a LED on a Raspberry Pi, so off I went to build that circuit. The circuit has a LED with a 330 ohm pull up resistor on GPIO pin 18 on the board. The sample python code on the page above just blinks that LED, which I used to make sure that the circuit as working as intended. To configure the GPIO pin as a switch in Home Assistant, I added the following to configuration.yaml (noting that the empty rpi_gpio entry isn't strictly required, but will be later): rpi_gpio: switch: -…

Continue ReadingAdventures in Home Assistant Raspberry Pi GPIO

HomeAssistant configuration

I've recently been playing with HomeAssistant, which is quite cool. Its not perfect -- for example it broke recently for me without any debug logs indicating problems because it didn't want to terminate SSL any more, but its better than anything else I've seen so far. Along the way its been super handy to be able to refer to other people's HomeAssistant configurations to see how they got things working. So in that spirit, here's my current configuration with all of the secrets pulled out. Its not the most complicated config, but it does do some things which took me a while to get working. Some examples: The Roomba runs when no one is home, and let's me know when its bin is full. A custom component to track when events last occurred so that I can rate limit things like how often the Roomba runs when no one is home. I detect when my wired doorbell goes off, and play a "ding dong" MP3 in the office yurt out the back so I know when someone is visiting. ...and probably other things. I intend to write up interesting things as I think of them, but we'll see how we…

Continue ReadingHomeAssistant configuration

End of content

No more pages to load