To analyze some guests claims that it is cold in my place, I built a little weather station. More details to come, but here already a few first impressions.

Some trivia:
  • The outside sensor is put into a ping-pong-ball for protection (great idea from my sister).
  • Never trust your sensors: my DHT21 readings were totally off and it took a lot of digging to find it was not my fault.
  • It was cold....
Some Soldering Test Setup
A friend asked me to provide him with a push message to his phone whenever his washing machine is done (since it is a bit far away and has no time indicator). The result was the following:
A single cycle of laundry in my machine as seen by the power meter.
  • A smart Plug (I use the Avatar AWP07Lv2) flashed with Tasmota sends its Power Reading to my MQTT broker (1/min when "on").
  • Whenever a reading arrives, a python client pushes it into a python "Streamz"-Stream
  • Inside the stream, the data is filtered and extracted.
  • Finally, the Sink checks if the moving average of the power has dropped to the "idling" level and then triggers a browser push-message on my phone (using Notify-Run in my case for the time being).

While this works nicely, I am currently fiddling on improvements. Mainly I think about using a control loop that retrieves dynamic readings of the Power meter to more accurately detect the idling level (can be +-1minute at the moment). But deployment to my friends place comes first.

Since this took me quite a bit to figure out, I will document it here, so that others may be faster.

While the DHT11 and DHT22 temperature sensors work fine on the Raspberry Pi using default (Adafruit) libraries, the AMS2301/DHT21 I intended for the outdoor measurements did not. At first, I suspected the sensor to be faulty, but then discovered that the sensor worked fine when using an Arduino with c-libraries. Not the sensor, then.

More investigation showed a strange behaviour: On the Arduino, both a DHT22 and the DHT21 sensor worked by using the same configuration (according to the specs, they actually use the same serial protocol, so this is normal). On the Raspi, however, the DHT22 worked fine but the DHT21 delivers nonsense-readings despite using exactly the same configuration and libraries for both sensors.

So why?....Well, it is due to the way the reading of the signals is implemented in the Adafruit circuitpython libraries for the Raspi and the AMS2301 sending some undocumented(!) dummy data at the end of its actual signal.

Schema of the DHT wire use.

How about a nice sunrise/sunset in your home? How about a simulated fireplace? Light server, light agent and bulb drivers.

After getting the 3rd Smart Bulb, toggling them individually did no longer suffice and using openHab became a bit clunky for my taste. So I decided to put the RasPi to work as the Head of a little light automation. More precisely, I had 3 use cases:

  1. Steer my Tasmota-flashed light bulbs color in flexible groups (e.g. all at the same time or just the ones in the office, etc)
  2. Triggering predefined sequences of color changes (e.g. sunset/sunrise) and allowing ad-hoc additions to said sequence on the fly.
  3. Going through colors continuously, where each step is either determined by a certain logic or the result of some random distribution of colors.
And of course Starting/Stopping/Triggering all these actions from my phone.

After collecting a few sensors that all give different values, it got too tempting to do some comparison of their quality.