Запилил кароч термостат.
http://subzero.l29ah.blasux.ru/jarmon/
∞ cat /usr/local/sbin/collectd-co2mond
#!/bin/zsh
temp_topic=/devices/7fe7/controls/relay/on
getheat() {
	mosquitto_sub -C 1 -t "$temp_topic"
}
setheat() {
	mosquitto_pub -r -t "$temp_topic" -m "$@"
}
set_temp=22
set_temp_hyst=0.3
INTERVAL=5
HOST=localhost
co2mond | while read -r name value; do
	if [[ "$name" == "CntR" ]]; then
		echo $value > /tmp/co2
		echo "PUTVAL $HOST/co2mon/gauge-co2 interval=$INTERVAL N:$value"
		if [ -e /tmp/fan_force ]; then
			cat /tmp/fan_force > /dev/fan
		else
			[ "$value" -lt 800 ] && echo 0 > /dev/fan || echo 1 > /dev/fan
		fi
	elif [[ "$name" == "Tamb" ]]; then
		echo $value > /tmp/temp
		echo "PUTVAL $HOST/co2mon/temperature-temp1 interval=$INTERVAL N:$value"
		if [ -e /tmp/heater_force ]; then
			setheat $(cat /tmp/heater_force)
		else
			curvalue=$(getheat)
			if [[ "$curvalue" == 0 ]]; then
				[[ "$value" -gt "$((set_temp - set_temp_hyst))" ]] || setheat 1
			else
				[[ "$value" -gt "$((set_temp + set_temp_hyst))" ]] && setheat 0
			fi
		fi
	fi
done
