Depending on your Linux distribution, the crontab will have a number of comments at the top, lines starting with a #, that explain how things work - worth a read. Once connected we'll run crontab -e to edit the user's crontab - the file that tells the scheduling daemon what commands to run and how often. We'll also want to get a reading as soon as the Pi Zero boots (or reboots), something we can also do with cron.Ĭonnect to the Pi Zero using ssh and login as the pi user. The easiest solution is to use cron to run the script every 5 minutes. That's not very practical given we want to get a regular stream of data across to Home Assistant. In the last part of this series we wrote the script that queries the sensors, but it was only running on demand (when we ran python3 humidityTemperatureMQTT.py). Next we have to get this information to Home Assistant so we can do something useful - that's the topic of this post. I've already shown how to assemble the hardware and put the scripts together to publish the data from the sensors. After quite a few weeks off to spend time with my family, and studying for my CISSP I'm back with part three.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |