Weekend project: "Raspberry Pi Pico Weather Station" by @stfn

Right now, I only have a BME280 sensor and a Pico 2 W, solar power will have to wait. Sensor readings look good!

#micropython #pico2 #bme280

https://stfn.pl/blog/02-pico-weather-station/

The Pico 2 W now sends MQTT messages to Home Assistant, via the Mosquitto broker add-on.

The sensor is read by adding the following snippet to HA configuration.yaml:
...
mqtt:
sensor:
- name: "Temperature"
state_topic: "weather/inside"
suggested_display_precision: 1
unit_of_measurement: "°C"
value_template: "{{ value_json.temperature }}"
- name: "Humidity"
state_topic: "weather/inside"
unit_of_measurement: "%"
value_template: "{{ value_json.humidity }}"
- name: "Pressure"
state_topic: "weather/inside"
unit_of_measurement: "hPa"
value_template: "{{ value_json.pressure }}"
...

I also added the InfluxDB add-on, for possible longer data retention.

#micropython #pico2 #bme280 #homeassistant #mqtt #influxdb

By adding "unique_id and "device_class" to each measurement, I get proper icons in the overview, I can rename them, and add them to a zone in Home Assistant:

...
mqtt:
sensor:
- name: "Temperature"
unique_id: "inside_temperature"
state_topic: "weather/inside"
suggested_display_precision: 1
unit_of_measurement: "°C"
value_template: "{{ value_json.temperature }}"
device_class: "temperature"
- name: "Humidity"
unique_id: "inside_humidity"
state_topic: "weather/inside"
unit_of_measurement: "%"
value_template: "{{ value_json.humidity }}"
device_class: "humidity"
- name: "Pressure"
unique_id: "inside_pressure"
state_topic: "weather/inside"
unit_of_measurement: "hPa"
value_template: "{{ value_json.pressure }}"
device_class: "pressure"
...

#homeassistant #mqtt

@mjack @stfn obligatory comment: do not forget to check Zeptoforth out.
GitHub - tabemann/zeptoforth: A not-so-small Forth for Cortex-M

A not-so-small Forth for Cortex-M. Contribute to tabemann/zeptoforth development by creating an account on GitHub.

GitHub
@mjack Thank you for the mention, I hope your project will work out great :)