5 ms·
Always a nice surprise to find my stuff on the front page. If you have any questions about Microdot, I'm here to answer them!
by miguelgrinberg 1y ago
Always a nice surprise to find my stuff on the front page. If you have any questions about Microdot, I'm here to answer them!
- xrd 1y agoI really love this post. The author did a great job with their writeup, and that probably came from a clear presentation. I'm fascinated by your approach where you used your own temperature and humidity monitors. Apologies if this is in the links in the article, but I wondered how you controlled your heating unit. The reason I ask is that I have a nest device talking to my AC unit, which means I'm locked into the Google ecosystem. It works well, but it doesn't connect to the Home Assistant system for everything else in the house. I would like to remove the Nest dependency, or at least have multiple ways I could start optimizing the power utilization of my AC unit.
- miguelgrinberg 1y agoThanks. The smart heating device in question is one that is fairly popular in Ireland, but I believe it isn't sold elsewhere. The brand is Climote (https://www.climote.ie/ https://www.climote.ie/). As part of the service, this controller gives you the option to send commands through an app, or by sending SMS (the device comes with a SIM card and gets its own mobile number). The commands would allow you to ask if the heating is running or not, to turn the heating on or off, and so on. I first implemented the SMS interface with Twilio, but then found that the number of texts you can send to the device is capped. I don't remember what was the monthly allowance, but I reached it in a few days after querying the device every 15 minutes or so 24/7. I then found a project on GitHub with the reverse-engineered API that the phone app used to send commands. So I then reimplemented the command logic using this API to be able to talk to the controller without limitations. I'm not familiar with the Nest devices, but I'd suggest you do a search on GitHub to see if someone figured how to reverse-engineer its API.
- xrd 1y agoNest devices do integrate, sort-of, with Home Assistant. But, the process is to create an "app" inside the Nest + Google home automation ecosystem. It is an absolute mess and there is nothing to be gained by going into that Mordor. I tried to get it working, and gave up, but I would much rather use a device that is "hackable." That device you mentioned looks great, and does not appear to be available outside of Ireland, as you noted. But, I'm going to use that as an inspiration point and see if I can find something similar. Maybe that manufacturer has awareness of a US-based device provider, I'll contact them. Really appreciate you sharing this work, really fun stuff!
- zrobotics 1y agoIf you're in north America (probably elsewhere, but I can only say for NA) then changing the thermostat is super simple to do. If your system is 24v, which is very likely, then swapping the nest device for something better isn't too complicated. I can't provide a brand recommendation, but I'd find a thermostat that supports homeassistant and has a reverse engineered API available. Directly controlling the HVAC with a relay board would also be very doable, but is a more involved project.
- xrd 1y agoI installed my nest, and it was indeed very simple. And, it appeared to work with Home Assistant, but like I said, the devil is in the details. It was a very frustrating experience. The problem is that if I look here I cannot tell the first thing about which device is supported and how well. HA does not have a great filtering system. https://www.home-assistant.io/integrations/#climate https://www.home-assistant.io/integrations/#climate
- deleted 1y ago[deleted]
- HexDecOctBin 1y agoWhy did you want the server to use Python? It seems simple enough to be easily be done in bare C.
- miguelgrinberg 1y agoI wanted to use MicroPython for this. I have nothing against C, it is a language that I actually know and use for other projects, but I wanted the challenge to try to build something similar to Flask or FastAPI that could run well on small devices.
- Tepix 1y agoI looked at your benchmark article. I would like to see how many requests per second these SoCs with your server can manage on a simple task (printing the current time) - both with http and https. Cheers!
- miguelgrinberg 1y agoYou are more than welcome to evaluate Microdot on the specific device you are interested in. It is good to keep in mind that people don't run web apps on microcontrollers because they have good performance. Don't expect any miracles.
- simpaticoder 1y agoYes, I also wanted to comment on the benchmark article[1], because it seems you looked at compute-bound performance rather than rps (requests per second) on simple data. Given that what you made, MicroDot, is a web server, it would make more sense to stress it rather than MicroPython and the SoC, no? That would seem to be more of the purview of the MicroPython and/or SoC devs. 1 - https://blog.miguelgrinberg.com/post/benchmarking-micropython https://blog.miguelgrinberg.com/post/benchmarking-micropytho...
- miguelgrinberg 1y agoYou got it backwards. If I were to release a benchmark for Microdot, everyone would say that it is biased! The article you are referring to is intended to benchmark microcontrollers running MicroPython. Nothing to do with Microdot. I'm not really sure what conclusions you expect to reach if you had a Microdot benchmark that gives you a requests per second number. I would not stop using microcontrollers if the number was low, and I wouldn't start more projects if the number was high. I don't really care. It works for the intended purpose.
- Tepix 1y agoI think it would be valuable to decide if the performance is sufficient for a desired purpose. If the performance is insufficient you may need to switch to something written in a compiled language or to a faster platform. That's why the RPS is useful.
- dave333 1y agoI need to measure temperature at multiple points and humidity in my experimental garden shed with a skytherm roof [ http://www.solarmirror.com/fom/fom-serve/cache/30.html http://www.solarmirror.com/fom/fom-serve/cache/30.html ] for passive heating and cooling. Thinking your thermostat code might be 90% of what I need however I don't yet know python. I guess it's easy to understand and modify the code with the help of AI.
- MomsAVoxell 1y agoFor my embedded needs, I've relied heavily on TurboLua, which I find really kicks some serious butt: https://turbo.readthedocs.io https://turbo.readthedocs.io What's great is that signals and fd_sets are supported, so it can really tie the web services and the hardware together nicely. I can easily wire up GPIO, for example. I haven't dug into Microdot yet - but are there similar mechanisms? I love my Lua projects based on TurboLua, but wouldn't mind seeing some python chops get sharpened, same-wise ... Edit: I dug in, and I guess the things I want are to be found in the python batteries included anyway .. plus, Microdot is a very small tack-on to microPython, and a pleasure to read ..
- miguelgrinberg 1y agoRight. Microdot just gives you the support to build the web application. This is built on top of the standard asyncio Python library, so you are likely to find good support for most tasks in the ecosystem.
- mdaniel 1y agorelated: Python has had async for 10 years – why isn't it more popular? - https://news.ycombinator.com/item?id=45106189 https://news.ycombinator.com/item?id=45106189 - Sep, 2025 (293 comments)
- miguelgrinberg 1y agoIt's important to note that for most small devices that run MicroPython asyncio is the only available method of concurrency. These devices have no concept of processes, your application is the only thing that runs. Most devices do not support threads, and those that do have really big limitations. Like for example, a device with two cores would allow you to spawn just one thread, to run on the second core and that's it. This is due to the lack of a proper operating system with a scheduler that can move threads in and out of the CPU.
- MomsAVoxell 1y ago