Weatherboard zero review and integration into Home Assistant

Post Reply
User avatar
mad_ady
Posts: 12034
Joined: Wed Jul 15, 2015 5:00 pm
languages_spoken: english
ODROIDs: XU4 (HC1, HC2), C1+, C2, C4 (HC4), N1, N2, N2L, H2, H3+, Go, Go Advance, M1, M1S
Location: Bucharest, Romania
Has thanked: 663 times
Been thanked: 1298 times
Contact:

Weatherboard zero review and integration into Home Assistant

Post by mad_ady »

Hello everyone!
I received a Weatherboard Zero board bundled with my M1S, and I've been playing with it for a week or so. I like it very much, and I'd like to share some impressions (good and bad).

First - some bad things:
1. When you plug it into the M1S (haven't tried other boards, but it might be similar), the weatherboard zero touches the foot of the heatsink. You need to push it a bit, so that it enters (forced). But once in, it works
2. Once plugged in, the case on the M1S doesn't snap into place anymore. It bulges and you can see that it hits against the weatherboard zero's PCB. I had to remove the cutout for the GPIO pins (was going to do it anyway), and then the case can close.
3. While mounted directly in the pins, the temperature and humidity are severely affected by heat generated by the SBC. For reference, the M1S was bolted to the VU8S screen (which was not enabled), and the weatherboard was below the heatsink. Here's some evidence:

Image

Green is Weatherboard zero temperature, yellow is a onewire DS18b20 temperature sensor, connected to a different Odroid, in the same room, but about 3m away. In red is the difference between the two sensors. As you can see, with the weatherboard mounted on the GPIO pins directly, there is about 12-13C of difference in measured temperature, when the M1S is idle. At step (2) I ran stress-ng -c 4, and you can see that the weatherboard temperature shot up, humidity plummets, while the onewire sensor remained constant.

4. The sensors report up to 1 mili-celsius/1mili-percent resolution for the measurements. This might be nice, but I'm not sure what the actual accuracy is, nor what the noise level is. lm-sensors show just 1 digit, but if you read the sensor via the API you get all the digits. Make sure you truncate/round them to avoid getting a lot of jitter. Not necessarily a bad thing, but something to keep in mind.

So, I don't recommend using it as advertised, directly inside the case, unless you plan on measuring case temperature (which was a few degrees cooler than the heatsink, so using the onboard sensor should be enough).

Now, the good things:
1. In step (1) you can see a dip in humidity, and a small decrease in temperature. That's actually a window open, and humidity drops faster/more pronounced (during winter) than temperature. It's a good way to measure for open windows/doors for your home automation. But it gets better! You can see a sharper decrease of humidity in step (3), (7). In fact, I was measuring open windows by sharp drops in temperature, but it seems humidity is much more accurate!
Image
2. Next, I moved the sensor and added dupont wires 20cm long (step (4)). The sensor is next to the M1S, but not inside the case. The difference between weatherboard temperature and onewire sensor drops to about 1C (which is acceptable). Since the sensor was next to my H3, you can see slight rises in measured temperature (5), (8), caused by my H3's exhaust. But, when the H3 is off (6), you can see that both sensors are in sync.
Image

So, I recommend getting the weatherboard zero with some 20cm long dupont wires, and you should be good to go.

Next - here's how you can integrate it with HomeAssistant. There are many ways in which you can do it (e.g. via Glances: https://www.home-assistant.io/integrations/glances/), but I chose my own way.
You can find here a python script that uses pysensors to read data from lmsensors and exposes it via MQTT, so that it can be used by HomeAssistant (or in my case, grafana): https://github.com/mad-ady/home-assista ... al-scripts

Prerequisites:

Code: Select all

# Prerequisites:
# * pip: sudo apt-get install python-pip3
# * paho-mqtt: pip3 install paho-mqtt
# * pysensors: pip3 install pysensors
# * python-yaml: sudo apt-get install python3-yaml

# Configuration file goes in /etc/temperature-lmsensors-mqtt-agent.yaml and should contain your mqtt broker details. 

# For startup copy temperature-lmsensors-mqtt-agent.service to /etc/systemd/system/
# Startup is done via systemd with
#  sudo systemctl enable temperature-lmsensors-mqtt-agent
#  sudo systemctl start temperature-lmsensors-mqtt-agent
Configuration sample (omit mqttUser, mqttPass if your broker doesn't have authentication):

Code: Select all

mqttServer: 127.0.0.1
mqttPort: 1883
mqttUser: odroid
mqttPass: odroid
mqttPersistent: True
sleep: 10
sensors:
  - name: Weatherboard Zero Temperature
    chip: shtc1-i2c-0-70
    sensor: temp1
    mqttTopic: dev/weatherboard_zero/temperature
  - name: Weatherboard Zero Humidity
    chip: shtc1-i2c-0-70
    sensor: humidity1
    mqttTopic: dev/weatherboard_zero/humidity
  - name: SOC Temperature
    chip: soc_thermal-virtual-0
    sensor: temp1
    mqttTopic: dev/m1s/temperature
You can get the chip/sensor name from the sensors command:

Code: Select all

$  sensors
shtc1-i2c-0-70
Adapter: rk3x-i2c
temp1:        +23.7°C  
humidity1:     46.7 %RH

soc_thermal-virtual-0
Adapter: Virtual device
temp1:        +34.4°C  (crit = +115.0°C)

gpu_thermal-virtual-0
Adapter: Virtual device
temp1:        +33.1°C  

These users thanked the author mad_ady for the post (total 4):
mctom (Tue Dec 19, 2023 2:51 am) • hominoid (Tue Dec 19, 2023 5:48 am) • Luke.go (Tue Dec 19, 2023 8:45 am) • odroid (Tue Dec 19, 2023 9:38 am)

User avatar
mctom
Posts: 4135
Joined: Wed Nov 11, 2020 4:44 am
languages_spoken: english, polski
ODROIDs: XU4, M1, H3+, SP3, N2L, M1S, N2
Location: Gdańsk, Poland
Has thanked: 609 times
Been thanked: 828 times
Contact:

Re: Weatherboard zero review and integration into Home Assistant

Post by mctom »

There was a prophet who foresaw that weatherboard directly on GPIO will not work as expected, but I'm glad you confirmed his visions. ;)

Most measurement instruments have resolution greater than accuracy. If you think about it, that would be terrible if resolution wasn't sufficient to use the full potential of a device.
Instead of truncating the least significant bits or digits of your readout, the proper way is to implement moving average. Just like SmartPower3 does to measure current. ;)

The more samples you average, the greater accuracy you will get, as long as the background noise is truly random. It will not fix the sensor's constant, added error, but won't make stuff worse either.
The benefit of that is "lowering noise floor" down to a level when you can detect very small changes in temperature. I wouldn't be surprised if you could detect a 0.05 C drop with this technique.
The drawback is slowed down response, as moving average acts as a low pass filter at the same time.

But that's of course just a theory rather irrelevant to home automation.
Punk ain't no religious cult, punk means thinking for yourself!
OpenUPS
PiStackMon

User avatar
rooted
Posts: 10627
Joined: Fri Dec 19, 2014 9:12 am
languages_spoken: english
Location: Gulf of Mexico, US
Has thanked: 822 times
Been thanked: 736 times
Contact:

Re: Weatherboard zero review and integration into Home Assistant

Post by rooted »

Very nice, I also have the sensor but haven't had the need to use it yet. I was certain it would need extended beyond the GPIO as the SoC heat would severely skew results from the room if that's what one is after.

Post Reply

Return to “Weather Board”

Who is online

Users browsing this forum: No registered users and 3 guests