I'm sure i'll have fun with that! It feels like going back to the beginning again!
I'm sure you will have fun too. I get a good measure of satisfaction when I get to improve my version 1's (and v2's). Theres always room for improvements
Actually you have motivated me to so something very similar in that I want to monitor the humidity of the loft void above my conservatory ceiling. I replaced the glass roof with a proper sloping roof designed as a warm roof, but then went on to put in lower flat ceiling creating a void. I contemplated putting in ceiling vents to allow air circulation but did not actually do so. I have been popping my head through a ceiling hatch to have a visual look to see if I have any condensation issues from time to time, but I should really pop a humidity sensor up there.
So now motivated thank to your posting, I've been giving a bit of consideration as to the design. I will power the microcontroller board for the loft via a battery so a board with lower power consumption in sleep mode is indicated. A reading every half an hour would seem sufficient.
I will try out a rpi pico, but I also have an ESP32 TinyPico board and will test that as well to see which makes the battery last the longest. Of course either board will be running micropython and the code for each will be very similar. I already have a dedicated mqtt broker running on an RPi4 which also runs a mysql database server as well. I have another rpi4 that runs mqtt client programs to receive data from various sensors, display the data, and store it in the database for later analysis.
The rpi pico or the TinyPico will be using the excellent micropython async mqtt library by Peter Hinch, but as this uses async its probably not for beginners just starting out as its take a bit of getting used to programming the async way. When I have programmed my test program you will be welcome to have a copy, but you will be best advised to stick with your current micropython library.
The client code that runs on the rpi4 will just be another subscription to my mqtt programs that receives the data from the other sensors, so it will do a lot of stuff you would not need. However I did give an example of a rpi4 mqtt client program earlier in this thread.
A final though for you is that I think you should keep your rpi4 program as just one module and not to split it up into several files. (of course import all the python modules you need)
As programs get larger and for use of re-using your chunks of code in other projects then its a good practice to create several modules. But considering the size of the program you are producing this may just add to the complexity especially for a beginner.
If you put all the mqtt operations into a separate module then consider what you want to happen when a message arrives. This separate module could just plonk the data into a file, but if you populate global variables and then use these variable in the code in your main file, then you have to consider how your code, in the main module, will be alerted to the fact a global variable has been updated with a new value.
I'm in the habit of having a 'mqtt connect' module for easy import into other projects. In my main program I call the connection function in this module, pass it the subsections I want it to make (as a list) and receive back a connection object. In the main program I create the on-message function and assign my connection object to that function e.g. myclient.on_message = on_message. So my main program can be directly altered when an mqtt message is received. I hope I making sense
But for beginner I would recommend you simply put all you code into one main file. Probably best not to complicate your programming at this stage. As you can see if you examine the rpi4 mqtt code snippet I gave, theres not many lines of code required for both the mqtt stuff and a function or 2 to handle incoming messages, save the data to a file and print the data. It's a good starter example.
I'm working on some other stuff and it will be a few weeks before I have my completed test micropython code running but I will post it on here in case it proves to be of any interest to you when its ready However I expect you will have your own version2 programs running by that time