cutie lives!

Ooh, diagrams...

I just published a new major version of cutie! As software goes, it's still pretty immature, but it is functional enough to do real work now. But! Let's take a look at the real-world work that I'm doing with it. If you're curious about the motivation behind writing it, I wrote another blog post about that.

The task

I've got two temperature / humidity / pressure sensors (BME280, to be exact) attached to raspberry pis. I need to:

  • Take temperature / humidity / pressure readings (note that the library for this provides the temperature reading in Celsius) and offset the temperature reading by a static amount (because the sensors don't adjust for self-heating).
  • Sample multiple times, then aggregate those samples.
  • Send the aggregated temperature / humidity / pressure readings to influxDB for long-term storage (preferably in Fahrenheit).
  • Send the aggregated temperature / humidity / pressure readings to an MQTT topic that home assistant is listening to (preferably in Fahrenheit).
  • Send only the temperature reading to a different MQTT topic that the air conditioners listen to for thermostat feedback (instead of using the temperature sensor internal to the unit). Because of how the AC firmware works, this reading has to be in Celsius, rounded to 1 decimal point.

The solution

Previously, I wrote bespoke handlers for the sensor and destination that did these things in code. It was an alright solution (it worked!), but it was highly specific to my setup. Now, I'm using cutie to build this behavior as configuration out of generic building blocks (comments/transformed data in red, outputs in green):

A full diagram of a cutie sampling/transformation pipeline for temperature data.
Comments & changes to data in red, outputs and labels in green.