Fun with Homekit, Smart Light Notifications on Raspberry PI temperature

in Smart Home11 months ago (edited)

I'm maintaining a Raspberry Pi 4 Model B (4GB) to host some tools & applications at home.

  • Deconz (Zigbee gateway software of Conbee)
  • Homebridge (A bridge to define non-Homekit accessories to Homekit)
  • AdGuard Home (Personal DNS server to block ads at the DNS level)

I've heard some CPU temperature problems at first, so in the first installation, I've bought this aliminium heat sink case.

Image is taken from kiwi-electronics listing page

It looks quite cool and includes double fans to make sure the temperature of Pi in acceptable levels. However, after running this case and the fans a couple of days, I was disturbed by the level of noise of the fans. It creates a lot of noise. I store pi in the closed cabinet (working headless) below a closed door in the first floor. (I sleep in the second floor, yet, I can still hear the sound of the vibration created from the fans at nights.)

After running a couple of weeks like that, I see that the CPU was running around 38°, 40°. I also observed CPU load and ram usage, and it was all perfect. Since the RPi 4b is quite powerful, CPU load stays around %1-%5, and memory usage was like 10% at most. So I've decided to stop the fans. That made the Pi perfectly quite but the temperature is stable around 48°-50°, which is also acceptible.

However, I don't want to run Rpi more than 60°, so I'll be observing the temperature levels more. I've setup a couple of scripts for that, but also I've added a new "automation" rule to get notified if the CPU temperature passes a certain degree.

Homekit automations

I consolidate all my smart home appliances at Homekit so that I can manage all my automations in one place. (By the way, that's a good thing to do, since almost every brand want to force their automation structure, and it becomes a mess when you manage automations in different places.)

What I need for this specific automation are:

  • When Raspberry Pi CPU Temperature passes a certain degree (Trigger)
  • Switch on the lights, dim to 100%, and make the light red on my workspace (Action) (Hue light bulbs)
  • (If I am at the workspace) (Condition) (Via a tilt sensor on the chair.)

Normally, this kind of automation is not supported at the Apple Home app, however, Homekit specs support this. So, by using Eve app, I can accomplish this. (The app is free to use, works on the top of Homekit.)

However, there was one small problem, I need to expose RPi temperature to Homekit. Fortunately, this could be done via a homebridge plugin, exposes CPU temp. into Homekit.

Now that, I have everything I need, here are the steps:

Set scenestep1
Add trigger
Add condition
Final result

All set. :)

Smart-Home Community

We have Smart Home community in place for a while. Feel free to share your own experience and adventures on the topic.


Show us the original image that you have! Interesting, the outcome!

This looks quite fun, would love to try it with my pi!


Why did you get the 4GB? Are you using that much ram?
There isn't much that goes over 2GB that you would run on a Pi, and the 2GB dropped down to 1GB price, so they seem to be the sweet spot right now.

The price difference was not much. And I'd like to host more stuff in time with the Pi, so bought a 4GB one, but I agree 2gb looks like a sweet spot at the moment.

I’m ordering a few 2GB but want to get a 4GB to try running a Bitcoin node on.

Just don’t see a lot of need for 4GB as anything that needs that much a Pi typically doesn’t do well. But there are some use cases like a Bitcoin node, clusters, and so on that’s why I was curious if you were using much ram.

What are your use cases on multiple pieces? Additional thought: 4 GB might be enough to run MIRA with a SSD attached.

I currently have around 10 Pis.

I use one on my 3D printer for "octoprint" which allows me to print over the network rather than moving an sd between computer and printer as well as other things.

I have one on tv for RetroPie to play 8000+ games from before 2000 on 50 different consoles.

I have a Pi zero for same purpose but for the portable RetroPie I made.

I use one for my wireless controller for Ubiquity devices.

One for Pi Hole for network wide ad blocking.

I got another one on my tv as a plex client (media center viewer).

Got one attached to a camera I use from time to time for projects like time lapse.

I got one for my son to learn programming and electronics but he really just doesn’t have interest.

Then I have a few just lying around (Pi 2 my first, and a few 3’s and zeros spare).

I haven't tried AdGuard Home, curious how it compares to PiHole.

There is a comparison here. I tried both, using Adguard Home for now. It felt simpler, more clean to me.