1. 42
  1.  

  2. 7

    Really cool project, and great to see homegrown home automation as opposed to it all running on a “cloud” which can disappear at any time.

    1. 8

      Maybe it’s my age showing, but I’m reluctant to deploy home-grown automation solutions because they inevitably break or others in the house get frustrated with them.

      My garage monitoring solution is an off-the-shelf Z-wave garage door tilt sensor that sends updates to my Z-wave network, which are picked up by Indigo running on a Mac Mini. This starts a timer and sends a Pushover notification to my wife and me if the garage door is left open for more than 10 minutes.

      1. 3

        Maybe it’s my age showing, but I’m reluctant to deploy home-grown automation solutions because they inevitably break or others in the house get frustrated with them.

        This was front of mind when building this project. I tried hard to reduce the surface area of breakage in this project by stripping the system image down a lot. Time will tell I suppose :)

        1. 2

          I’m with you there. I have the same setup, but with node-red. This particular sensor is on Zigbee, but the door controller is on Z-wave. I want local control, but for technical ownership of these problems I want as close to zero as possible.

          1. 2

            Their is always a risk with external services being not available anymore, like Insteon Shutdown. But I really dislike “face-lifts” or behaviour/feature changes for apps. It’s annoying and most often this change doesn’t have a benefit for me. Something like a rearrangement of products in your favourite supermarket. I try to use simple solution to avoid the not working frustration. For my Hue lights I just used two modes (bright or dimmed) which I can set with a text message to my XMPP bot. I also use this bot to get the current outside temperature or to send me a reminder via email.

        2. 4

          daemon — process supervisor to restart the garage-door-monitor binary if it exits for some reason.

          As a systemd enthusiast, I was triggered. But I will let it go :) , since it’s an embedded system, and systemd would add around 2MB (= a whooping 15% increase in image size)

          deamon is a good alternative. I also wanted to mention runsv from runit which can be used to auto-restart, and should be appropriate for embedded systems.

          1. 2

            The challenge now would be to move on to a less overkill hardware platform (like rp2040 or gd32v), and a thinner and more reliable software stack (a RTOS e.g. Genode/seL4, nuttX).

            This is much easier to do at this point, where you already got something that works.

            1. 3

              Would love to do that. I’ve built bare metal things in Rust on ARM Cortex microcontrollers using RTIC before but the need for Wi-Fi limits things at the moment. Progress is being made on the Espressif front—they hired someone to work on Rust support for their devices and the most recent update noted preliminary support for Wi-Fi so perhaps it’s not too far off.

              1. 2

                esp-idf is a rather decent C SDK. Rust or no Rust. It would be a pretty easy project. You might not even need to allocate any heap memory (yourself) for this simple use case.

              2. 1

                depends what you mean by reliable. i would just go for Openwrt Linux. will result in a much smaller system, and has its own robust init and process monitoring systems.

                1. 1

                  I would avoid Linux. It has way too much code (both kernel and userspace, even for distributions like openwrt) to even talk about reliable.

                  Nevermind Linux, for the task at hand, not even dynamic memory allocation is required or desirable.

                  1. 4

                    just depends on what you are prioritizing. you mentioned several experimental projects like genode and sel4. i would not waste my time unless i really cared about this or wanted to experiment with those projects specifically. openwrt would allow for a quick iteration with a substantial size reduction.

                    1. 2

                      Yeah, it’s all about priorities. I’d jump at the chance, in a setting where there’s no time constraints like such a personal project.

              3. 2

                Nice project and a great write up! I implemented something similar a couple of months ago using the built-in Hall effect sensor on an ESP32, with some server-side processing in Rust to generate the notifications.

                This project did some things better than I did though - I particularly like the status LED, the web interface, and the minimal OS image. And that everything is properly finished (eg not wrapped in an antistatic bag!).

                1. 1

                  16 comments and not one mention of Home Assistant? :D

                  Cool project tho. I would have been lazy and just used ESPHome and an ESP32 - a few lines of YAML for the microcontroller, a few more for setting up the notification in Home Assistant and then a few more to create an automation to send the notifications.

                  1. 1

                    Thirteeen megabytes! Holy hell that’s huge!

                    1. 1

                      I do this but with a cheap ESP32, instead of a Raspberry Pi. I use Argo’s on Linux and SwiftBar on macOS to display status.