Alternative means of measuring room temperature

(Brian Orpin) #1

As much as I like the EmonTH, for me they are simply too expensive for general deployment round the house, so I have been after a cheaper alternative for a while.

I think I’ve at last found a solution.

It consists of these Xiaomi Mijia Bluetooth Hygrothermograph devices (available for around the £10 mark) with the data read using this node-red module node-red-contrib-xiaomi-ble and a PiW Zero. One advantage of these devices is they also have a display.

Whilst they are likely to not be as reliable (in reading data terms) or accurate as an EmonTH (the temperature does oscillate), they work sufficiently well to be used to manage room temperatures especially when the readings are fed through a filter.

I’m using this PiW Zero to also do some presence detection using Bluetooth and the 2 seem to sit happily alongside each other.

Of course I then publish the data through MQTT and pull it into EmonCMS :smile:

433 MHz transmitter
(Derek Mansbridge) #2

Good solution - well done for finding that!
One problem with my installation though.
I have a Raspberry Pi 3 Model B Rev 1.2 running Raspbian GNU/Linux 8 (jessie) with EMONCMS +
My Xiamoi temperature / humidity device is paired (using bluetoothctl | scan; then pair ).
Pi shows device as paired using bluetoothctl | paired-devices.
Added “node-red-contrib-xiaomi-ble” version 1.2.3 using node-red “Manage Palette” and simple node-red flow: inject 1 minute timestamp into a Xiamoi BLE node (configured with ) which when deployed, “node-red-contrib-xiaomi-ble” node shows “searching” then (after timeout?) shows “not found” and node-red debug tab reports “Device not found among []”
Running bluetoothctl shows:

[CHG]  Device <my device number> Connected: yes
[CHG]  Device <my device number> Connected: no

continually alternating at ~5 second intervals
hciconfig shows "UP RUNNING", "RX..." and "TX ..." errors:0
Tried lots of things but still refuses to work.
Exactly the same as above on a pi-zero running “Raspbian GNU/Linux 9 (stretch)” works ok.
Any thoughts?
(sorry if this is a bit off topic)

(Brian Orpin) #3

What version of nodejs?

Ah, did you check out the docs?

Did you follow these instructions?

I did not bother to pair the devices - there is no need but perhaps it does interfere?

(Derek Mansbridge) #4

Problem solved with…
“sudo setcap cap_net_raw+eip $(eval readlink -f which node)”
…but only when I “un-paired” the device. Seems pairing was interfering somehow.
Many thanks for your help.