{"id":732,"date":"2024-08-29T07:03:03","date_gmt":"2024-08-29T07:03:03","guid":{"rendered":"https:\/\/yesa.org.za\/resources\/?page_id=732"},"modified":"2024-08-29T07:03:03","modified_gmt":"2024-08-29T07:03:03","slug":"microbit-and-home-assitant","status":"publish","type":"page","link":"https:\/\/yesa.org.za\/resources\/microbit\/microbit-and-home-assitant\/","title":{"rendered":"Microbit and Home Assitant"},"content":{"rendered":"<ul>\n<li class=\"heading-element\" dir=\"auto\" tabindex=\"-1\"><strong><a href=\"https:\/\/github.com\/robmarkcole\/HASS-BBC-envirobit?tab=readme-ov-file#hass-bbc-envirobit\" target=\"_blank\" rel=\"noopener\">HASS-BBC-envirobit<\/a><br \/>\n<img loading=\"lazy\" decoding=\"async\" class=\"alignnone \" src=\"https:\/\/community-assets.home-assistant.io\/original\/4X\/0\/4\/b\/04b7e3172e215e6f727c17f55b039ade3986ebcb.png\" width=\"301\" height=\"94\" \/><br \/>\n<\/strong>Stream button presses and BME280 sensor readings over the serial from the BBC micropython\u00a0<a href=\"https:\/\/github.com\/pimoroni\/micropython-envirobit\">envirobit<\/a>\u00a0to\u00a0<a href=\"https:\/\/www.home-assistant.io\/\" rel=\"nofollow\">Home-Assistant<\/a>.<\/p>\n<p class=\"heading-element\" dir=\"auto\" tabindex=\"-1\">BBC-envirobit setup &#8211;\u00a0<code>main.py<\/code><span style=\"font-size: 1rem;\"> should be flashed to the BBC microbit. On pressing the <\/span><code>A<\/code><span style=\"font-size: 1rem;\">\u00a0or\u00a0<\/span><code>B<\/code><span style=\"font-size: 1rem;\">\u00a0buttons 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\u00a0<\/span><code>sleep_sec<\/code><span style=\"font-size: 1rem;\">\u00a0which you can optimise). The number of decimal places that data is reported to is 1dp by default, but can be varied with the\u00a0<\/span><code>rounding_digits<\/code><span style=\"font-size: 1rem;\">\u00a0variable. Plug the microbit into the USB port on your Home-Assistant computer.<\/span><\/p>\n<\/li>\n<\/ul>\n<p dir=\"auto\" tabindex=\"-1\">\n","protected":false},"excerpt":{"rendered":"<p>HASS-BBC-envirobit Stream button presses and BME280 sensor readings over the serial from the BBC micropython\u00a0envirobit\u00a0to\u00a0Home-Assistant. BBC-envirobit setup &#8211;\u00a0main.py should be flashed to the BBC microbit. On pressing the A\u00a0or\u00a0B\u00a0buttons 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 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":69,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"class_list":["post-732","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/yesa.org.za\/resources\/wp-json\/wp\/v2\/pages\/732","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/yesa.org.za\/resources\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/yesa.org.za\/resources\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/yesa.org.za\/resources\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/yesa.org.za\/resources\/wp-json\/wp\/v2\/comments?post=732"}],"version-history":[{"count":1,"href":"https:\/\/yesa.org.za\/resources\/wp-json\/wp\/v2\/pages\/732\/revisions"}],"predecessor-version":[{"id":733,"href":"https:\/\/yesa.org.za\/resources\/wp-json\/wp\/v2\/pages\/732\/revisions\/733"}],"up":[{"embeddable":true,"href":"https:\/\/yesa.org.za\/resources\/wp-json\/wp\/v2\/pages\/69"}],"wp:attachment":[{"href":"https:\/\/yesa.org.za\/resources\/wp-json\/wp\/v2\/media?parent=732"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}