Educational Resources for Educators

Recent Posts

Microbit and Home Assitant

  • HASS-BBC-envirobit

    Stream button presses and BME280 sensor readings over the serial from the BBC micropython envirobit to Home-Assistant.

    BBC-envirobit setup – main.py should be flashed to the BBC microbit. On pressing the A or B buttons the display will scroll the pressed button. The buttons are displayed as a binary sensor in Home-Assistant and can be used to trigger automations. Data from the BME (temperature, pressure, humidity, but not altitude as these values were meaningless in my testing) are publihsed to Home-Assistant every second (the sleep time is a variable sleep_sec which you can optimise). The number of decimal places that data is reported to is 1dp by default, but can be varied with the rounding_digits variable. Plug the microbit into the USB port on your Home-Assistant computer.