Raspberry Pi Pico W control panel

So the Raspberry Pi Pico W was released last week, which brings WiFi support to this tiny £6 embedded system.

On hearing this, the first thought that occurred to me was that it would be really cool to use it to build something for Home Assistant.

So, I ordered one immediately, along with a display module, and over the weekend I built this:

Its functionality is quite primitive, and it is likely to stay that way due to the insane resource constraints on the Pico (just 264kb of RAM!) - but it works!

Next up is designing / printing a suitable enclosure, and figuring out a long-term solution for powering it.

9 Likes

Hi Rookeh,

Well done. That looks very promising as a simple, low cost interface to HA.
One application I think would be great with this is to use it as a room thermostat (just to set the desired temperature), given its cost one could easily envision to have one of those per room, controlling both lights and thermostat.
How difficult would it be to implement? Essentially, replacing toggle services with input_number to increase/decrease temperature, as well as a sensor that gives current temperature.

Cheers,
Alex

That’s a great suggestion. The next thing I was looking to implement was a simple view for sensors, but a thermostat control should also be fairly straightforward. I don’t think you would even need an input_number, as all the controls we need should be exposed by the climate service. The dashboard could just take the current target temperature of the thermostat and offset it by however many times you increment or decrement it via the controls, then send the adjusted value as an update. The third button might be able to be used to cycle between climate presets, or heat/cool modes.

I always forget the climate service, indeed much more integrated than working with input_number. I have not implemented home assistant control of heating in my place yet, I need to figure out which TRVs are best for my needs first.
Since you only have 4 buttons/sensors and one is reserved for room cycling I would suggest one button for -1 deg C, one for +1 deg C and one for current temperature, but that is probably because I do not have a HVAC at home, so no need to toggle between heat and cool :slight_smile:
An alternative to this, if there is one control panel per room and the user does not want to control other rooms, would be: -1, +1, temp, mode.

In any case, I think your solution can be applied in many different applications, and is one of the very few that can do it at such a low price and footprint. It would be really cool if we could build a flexible system around it so everyone could easily suit it to their needs.
Next step is integration in 3d printed case over a light switch :smiley:

Been a bit busy over the last few weeks, but this weekend I finally got around to implementing climate control and also better support for non-controllable entities e.g. sensors (the state of the entity is now displayed underneath the name and icon).

The climate functionality is currently pretty basic - once added to the config, the page will show the current temperature, target temperature, and the A/B buttons are used to increment/decrement the target temperature by one degree.

This is awesome, thank you!
I’m just getting my head around this, as I’m by no means a dev.
I’ve got the XPT2046 screen - would you have any thoughts as to what changes I might need to make for that to work instead of the screen in your code?

So all of the display-specific logic (aside from a few imports in main.py to turn off the LEDs on startup) is kept in display.py, so you will most likely want to start there. Your device would need to have a MicroPython library which would ideally expose functions that are similar to those implemented by Pimoroni for their displays. In any case, chances are high you’d need to take a hatchet to most of that class, if not completely rewrite it.

2 Likes

Well done! I haven’t had time to assemble my device yet but I am definitely looking forward to it.
Cheers

Nice Projekt, i Build it with my Son for my Hass, how can i disable the Display timeout and get the Button right Top to work? We are new to Python :smiley:

Greetz

Cool to hear! If you want to stop the display from sleeping, you can comment out lines 111-115 in main.py - or set the interval value from 10000ms to something larger if you would like to wait more than 10 seconds before sleeping the display. I will look to make this configurable in a future update.

Regarding the top-right button, as you add devices to the area each button will be enabled in sequence until you reach the maximum of three devices (as we need to reserve the fourth button, Y, for switching areas). Currently there is no way to assign a device to a specific button other than changing the order of your devices in the config.

1 Like

slighty unrelated but any chance of a way to do custom names btw
Some of my names in my home assistant dashboard are too long and overlap onto each other
edit: figured out you can just change the dashboard name for it