RuuviTagit ja Home Assistant

PÀÀtin tutustua tuohon Home Assistant ohjelmaan, kun kotona oli muutamia WLAN liitettĂ€viĂ€ lamppuja. HA pyörii vanhassa Raspberry Pi 3+ ympĂ€ristössĂ€. Ja siinĂ€ kĂ€vi kuten aina, eli kun antoi pikkusormen, niin se vei koko miehen


Mukaan tuli tietenkin RuuviTagit. Ensin sisĂ€lle tuo ‘perus’ RuuviTag, mittaamaan lĂ€mpötilaa, kosteutta ja ilmapainetta. Ulos ja saunaa hankin sitten RuuviTag Pron, ja varsinkin tuon saunan kanssa tuli vĂ€hĂ€n ‘sormenvoiteita’, eli kuuluvuusongelma.

SisÀ- ja ulkoanturin liittÀminen HA:han meni ihan Raspin omalla Bluetooth ominaisuudella, kun ovat saavutettavissa, mutta tuo saunan löylyhuoneen anturi on eri kerroksessa ja muutamien betoniseinien takana, eikÀ se kuulunut riittÀvÀsti, vaikka kÀnnykkÀ sen löytÀÀ (signaalin voimakkuus -98 - -100 dBm).

Ensiksi kokeilin tehdĂ€ toisesta Raspista (model 2) ylimÀÀrĂ€isen Bluetooth gatewayn, ja siirtÀÀ dataa HA:han MQTT:n avulla. KyllĂ€hĂ€n sekin toimi, mutta oli vĂ€hĂ€n tekemĂ€llĂ€ tehty


Hankin ESP32 moduulin, ja sillÀhÀn homma toimi todella helposti. Nyt on siis kolme anturia natiivisti kiinni HA:ssa, enkÀ oikein heti nÀe kovin monelle uudelle anturille kotioloissa tarvetta.

Muutama kysymys kuitenkin herÀsi:

  1. Kun luin antureita kÀyttÀen MQTT:tÀ, niin antureista sai enemmÀn dataa ulos kuin tuolla natiiviliitoksella. Miksi, ja onko natiiviliituoksella mahdollisuus saada noita muita datoja nÀkyviin (kuten ilman tiheys ja ilman vesimÀÀrÀ), vai ovatko ne laskettuja arvoja?

  2. Saunan seinÀÀn kiinnitetty anturi herÀtti kysymyksen siitÀ, ettÀ mittaako se seinÀn lÀmpötilaa vai huoneen ilman lÀmpötilaa? Onko tÀtÀ kukaan selvitellyt? PitÀisikö anturi nostaa seinÀstÀ esim. korotuspaloilla irti, jotta tuo suora kontaksi seinÀÀn poistuisi?

Nuo mainitsemasi ovat laskettuja arvoja, ja se riippuu hieman toteutuksesta mitĂ€ kĂ€yttÀÀ ettĂ€ mitĂ€ arvoja lasketaan. Yksi esimerkki tĂ€llaisesta löytyy tÀÀltĂ€ (englanniksi), missĂ€ tuon taulukon alussa olevat suureet ovat mitattuja (tĂ€mĂ€ tietysti riippuu tagin mallista mitkĂ€ ovat tuettu, esim. vedenpitĂ€vĂ€ RuuviTag Pro ei pysty mittaamaan kosteutta), ja tuon “Extended values” kohdan alta löytyy nĂ€istĂ€ mitatuista suureista laskettuja suureita mitĂ€ tĂ€mĂ€ esimerkin RuuviCollector ohjelmisto kykenee laskemaan.

Tarkalleenottaen anturi mittaa omaa lĂ€mpötilaansa, joka sitten riippuu siitĂ€ mitĂ€ lĂ€mpötilaa siihen johdetaan. Esimerkiksi saunan seinĂ€llĂ€ oleva tagi nĂ€yttÀÀ lĂ€mpötilaa joka on jotain ilman ja seinĂ€n vĂ€liltĂ€, ja tagin ottaminen “irti” seinĂ€stĂ€ tuo sen lĂ€hemmĂ€s ilman lĂ€mpötilaa. TĂ€mĂ€ sitten riippuu taas mm. saunan eristyksistĂ€ ettĂ€ miten suuri “heitto” tuossa on. ItsellĂ€ni omassa saunassani ero ei kovin montaa astetta ole, mutta olen silti virittĂ€nyt tagin roikkumaan katosta parin sentin pÀÀhĂ€n seinĂ€stĂ€ jolloin se nĂ€yttÀÀ “lĂ€hemmĂ€s oikeaa”.

Hienoa, ettÀ sait homman rokkaamaan. ItsellÀni kuuluvuusongelmat ratkesivat sillÀ, kun siirryin RPi3b:n oman BT-moduulin kÀytöstÀ liitetyn BT-donglen (halvin, mitÀ kaupasta löytyi) kÀyttöön (Ruuvitags in HA more and more unstable with time).

TĂ€tĂ€kin kokeilin, mutta etĂ€isyydet ja paksuhkot betoniseinĂ€t estivĂ€t signaalia. Tuolla ESP32 ratkaisulla sain siirrettyĂ€ yksikön riittĂ€vĂ€n lĂ€helle. SehĂ€n ei tarvitse kuin virtaa, eli vanhan puhelinlaturin. YksikössĂ€hĂ€n on sekĂ€ Bluetooth ettĂ€ WLAN, joten se integroitui hyvin yksinkertaisesti Home Assistentiin. Hintakaan ei pÀÀtĂ€ huimannut. Kaksi yksikköÀ postitettuna Ranskasta alle 20€.

Okei, hienoa! Laitatko tÀhÀn viestiketjuun vaikka linkkinÀ tuon ESP32-moduulin tiedot, niin jÀÀ tulevia kÀyttÀjiÀ varten vaihtoehto, jolla asian ainakin joku on saanut ratkaistua.

OK. Onhan se tosin vĂ€hĂ€n ‘noloa’ kertoa ja kehua tuotetta, joka on kilpaileva Ruuvin omalle Bluetooth gatewaylle
 Tosin olen itse ajatellut, ettĂ€ tuota gatewaytĂ€ tĂ€ytyy kesĂ€llĂ€ kokeilla mokillĂ€ rantasaunan lĂ€mpötilaseurantaan. Saa nĂ€hdĂ€ kuinka toimii, kun vĂ€lissĂ€ on kaksi hirsiseinÀÀ ja reilu parikymmentĂ€ metriĂ€ matkaa.

Eli, tÀssÀ videossa kerrotaan hyvin, kuinka helppoa ja yksinkertaista on tuollaisen ESP32 modulin kÀyttöönotto ja integrointi Home Assistantiin.
Itse hankin modulin tÀÀltÀ.
KÀnnykÀn laturi löyti laatikosta.

EDIT:

Sen verran tÀytyy vielÀ lisÀtÀ, ettÀ tarvitaanhan asennuksessa USB-kaapeli tietokoneesta tuohon yksikköön.

EDIT2:
TÀssÀ on parempi video siitÀ, kuinka ESP32 asennetaan toimimaan Bluetooth proxyna.

Google translates as:
I decided to familiarize myself with that Home Assistant program when there were a few lamps at home that could be connected to WLAN. HA runs in an old Raspberry Pi 3+ environment. And it happened as always, that is, when he gave the little finger, it took the whole hand


Of course, RuuviTags came along. First, bring in the ‘basic’ RuuviTag, to measure temperature, humidity and air pressure. I then got a RuuviTag Pro to go out and take a sauna, and especially with that sauna there were a few ‘finger creams’, i.e. a hearing problem.

Connecting the indoor and outdoor sensor to the HA went perfectly with Rasp’s own Bluetooth feature, when they are reachable, but that sauna steam room sensor is on a different floor and behind some concrete walls, and it was not heard enough, even if the mobile phone finds it (signal strength -98 - -100 dBm ).

First, I tried to make another Rasp (model 2) an additional Bluetooth gateway, and transfer data to HA using MQTT. Yes, it also worked, but it was done with a bit of work


I got an ESP32 module, and it worked really easily. So now there are three sensors natively connected to HA, and I don’t really see the need for many new sensors in home conditions right away.

However, a few questions arose:

  1. When I read the sensors using MQTT, I got more data out of the sensors than with that native connection. Why, and does the native interface have the ability to display those other data (such as air density and air water content), or are they calculated values?

Scrin replied:
Those you mentioned are calculated values, and it depends a little on the implementation, what is used and what values are calculated. One example of this can be found here (in English), where the quantities at the beginning of that table are measured (of course this depends on the tag model which are supported, e.g. the waterproof RuuviTag Pro cannot measure humidity), and under that “Extended values” section you can find these measured quantities calculated quantities that this example RuuviCollector software is capable of calculating.

  1. The sensor attached to the wall of the sauna raised the question of whether it measures the temperature of the wall or the temperature of the air in the room? Has anyone figured this out? Should the sensor be lifted off the wall, e.g. with lifting blocks, so that the direct contact to the wall would be removed?

Scrin replied:
Specifically, the sensor measures its own temperature, which then depends on what temperature is supplied to it. For example, the tag on the sauna wall shows a temperature that is something between the air and the wall, and taking the tag “off” the wall brings it closer to the air temperature. This again depends on e.g. about the insulation of the sauna and how big a “throw” there is. In my own sauna, the difference is not very many degrees, but I have still tuned the tag to hang from the ceiling a couple of centimeters away from the wall, so it looks “closer to correct”.

j_o
It’s great that you managed to rock it. My hearing problems were solved when I switched from using the RPi3b’s own BT module to using the connected BT dongle (the cheapest one I could find in the store) (Ruuvitags in HA more and more unstable with time).

V12
I tried this too, but the distances and thick concrete walls blocked the signal. With that ESP32 solution, I was able to move the unit close enough. All it needs is power, i.e. an old phone charger. After all, the unit has both Bluetooth and WLAN, so it integrated very easily with Home Assistant. The price didn’t make my head spin either. Two units mailed from France for less than €20.

j_o
Okay, great! If you put the information of that ESP32 module as a link in this message thread, then there will be an option for future users with which at least someone has been able to solve the issue.

V12
ALRIGHT. It’s a bit ‘embarrassing’ to talk about and praise a product that competes with Ruuv’s own Bluetooth gateway
 However, I’ve actually thought that I need to try that gateway in the summer with a mochi for beach sauna temperature monitoring. We’ll see how it works when there are two log walls and a good twenty meters of distance between them.

That is, in this video 1 it is well explained how easy and simple it is to implement and integrate such an ESP32 module into the Home Assistant.
I got the module myself from here 1.
I found the cell phone charger in the box.

I still need to add that a USB cable from the computer to that unit is needed during the installation.

* Here’s a better video on how to set up an ESP32 to act as a Bluetooth proxy.

Nyt on sitten ruokahalu kasvanut entisestÀÀn. Home Assistantiin olen asentanut InfluxDB tietokannan, ja tehnyt graafeja Grafanalla. Aika nÀppÀrÀÀ.

Ongelmaksi taitaa muodostua se, ettÀ Home Assistant lukee antureita aina, kun anturin arvo muuttuu, ja nÀmÀ Ruuvi anturit lÀhettÀvÀt uutta arvoa aika usein. En tarvitse kuitenkaan mitÀÀn sekunnin pÀivitystahtia, vaan rauhallisempikin riittÀisi.

Kuinkahan saisin tuon Home Assistantin pÀivittÀmÀÀn nÀiden Ruuvi antureiden lukemaa esim. 1min vÀlein?