Simple home assistant software (Part 2)

Published on: 24th July 2025

Tagged in picosensorshome assistant

With the hardware in hand, it was time to write some software. The first stage would be getting something set up on the Pico. It would need to:

  • Find and connect to a wireless network
  • Set the time
  • Read a sensor value
  • Upload a value to the server

I’m not doing any fancy automated setups and won’t be using smart home wireless solutions, so it’s plain ordinary Wi-Fi for this. I will also write the SSID and server details into the code as I’m just making this for me. It’s not great coding but configuring wireless and servers could be a big project in itself (and it’s not the project I’m doing right now!).

I also don’t need the absolute best performance so can use Micropython, which I’m much more comfortable with than C++. That’s also great because there are libraries ready to go for the sensor and the breakout garden which I’ll just have to import. The Python building blocks mean that the script takes up fewer than 100 lines of code.

For early testing I even plugged a tiny screen into the breakout garden so I could see the values that were being read. Writing to the display was easy because, again, there was a library ready to go. (Thank goodness for serious open support from great companies!)

Pico and screen add-on showing the temperature and humidity
A tiny screen updates in real time. Now I know it's working!

That proved that the Pico was reading values and trying to send them somewhere. I now needed something to receive them!

Gallery

Click to view larger versions.

Pico and screen add-on showing the temperature and humidity