Gateway ja Home Assistant

Hei. Olen takunnut monta iltaa jo yrittÀessÀni naittaa GatewaytÀ Home Assistantin MQTT-serverin kanssa. Tuloksetta. Voisiko joku vÀÀntÀÀ ohjeet rautalangasta? Osaaminen on sillÀ tasolla ettÀ olen juuri saanut HA:n pystyyn Raspiin ja tehnyt muutamia automaatioita sillÀ.

Mosquitto MQTT broker on asennettu oletusasetuksilla ja HA:han on luotu MQTT kÀyttÀjÀ. Gatewayn asetuksissa on MQTT serverin osoitteena homeassistant.local (olen kokeillut myös suoraan IP-osoitteella) ja portti 1883. KÀyttÀjÀtunnus ja salasana ne mitkÀ olin laittanut HA:n MQTT kÀyttÀjÀlle.

MitÀ tÀmÀn lisÀksi pitÀisi tehdÀ ja mitÀ lisÀosia kÀyttÀÀ?

Asennettuna on Ruuvitag Discovery (ei löydÀ mitÀÀn antureita) ja RuuviGWMQTT 2 HA jonka loki nÀyttÀÀ tÀltÀ:

[s6-init] making user provided files available at /var/run/s6/etc
exited 0.
[s6-init] ensuring user provided files have correct perms
exited 0.
[fix-attrs.d] applying ownership & permissions fixes

[fix-attrs.d] done.
[cont-init.d] executing container initialization scripts

[cont-init.d] done.
[services.d] starting services
[services.d] done.
yarn run v1.22.10
warning package.json: No license field
$ node index.js
mqtt connected
ruuvi/C3:F1:07:A4:7C:F7/<SENSOR_MAC_ADDRESS>/gw_status {“state”: “offline”}

Kiitos,

t. Mika

Home Assistant toimii nyt suoraan RuuviTagien kanssa: https://ruuvi.com/connecting-ruuvitag-bluetooth-sensors-to-home-assistant/

Mutta gateway ei toimi suoraan heittÀmÀllÀ Home Assistantissa.

1 Like

Nostetaas tÀtÀ hiukan ylemmÀksi kun on ilmeisesti vanhentunutta tietoa?
Eli suht lyhyesti.
Asennettu Home Assistant. Resetoitu varuilta Gateway, koska en saanut sitĂ€ mitenkÀÀn toimimaan. Laitettu wifiin ja pĂ€ivitetty versioon v1.13.1. Muuten kaikki “defaulttia”, mutta remote access settings sivulla advanced kohdasta remote API bearer token pÀÀlle (read only) ja tunnus talteen.

Integraatioista löytyi Ruuvi Gateway. Laitoin IP:n ja tokenin ensin vÀÀrin ja herjaili. Sitten oikein ja kaikki vaikutti hyvÀltÀ, mutta edelleenkÀÀn en nÀe kaikkia tageja. Miten pirussa tuon saa oikein toimiin? :face_with_raised_eyebrow:

Ruuvi BLE:t nÀkyy listauksena integraation alla, mutta tuo Gatewayn alle ei kyllÀ mitÀÀn ilmesty. MiksiköhÀn?

ItsellĂ€ni Gatewayn liittĂ€minen tökkÀÀ Home assistantin ‘Unexpected error’ -viestiin. Asetukset olen mielestĂ€ni tehnyt ohjeen mukaisesti, ja laiteohjelmistot ovat ajan tasalla, mutta ei vaan tahdo onnistua.

MistÀköhÀn johtuu, osaisiko joku neuvoa?

Hi @Ruikuli,
Could you check that the gateway responds correctly to “/history” using curl? You can find docs on how to do it here: Polling mode - docs
Also, if possible, connect the Gateway to a PC via USB and save the logs sent to the virtual COM port while you’re trying to configure it in Home Assistant.

Hi,

Thanks for helping.
Yes, it responds correctly (command line on a PC). Same data is available via web browser from “IP-address/history”.

From the Home assistant OS (on Raspbi4), I don’t know how to test it properly, but I tried with a webpage -card. It gives the same data as well.

Log from the Gateway. .206 = HA. .201 = Gateway:

I (2192923) http_server: [http_server/4] Request from 192.168.0.206 to 192.168.0.201 (Host: 192.168.0.201): GET /history
I (2192926) http_server: [http_server/4] Json resp: code=401, content:
{"success": false, "gateway_name": "RuuviGatewayGWGW"}
W (2192937) http_server: [http_server/4] Response: status 401 (Unauthorized), extra header fields:

( CLICKED HA 'SUBMIT' IN THIS POINT )

I (2194488) http_server: [http_server/4] Request from 192.168.0.206 to 192.168.0.201 (Host: 192.168.0.201): GET /history
I (2194494) http_server: [http_server/4] History on 60 seconds interval: {
        "data": {
                "coordinates":  "",
                "timestamp":    "1692020328",
                "gw_mac":       "GW:GW:GW:GW:GW:GW",
                "tags": {
                        "XX:XX:XX:XX:XX:XX":    {
                                "rssi": -64,
                                "timestamp":    "1692020328",
                                "data": "0201061BFF990405114F551DC5A00030FFE80408A9B66D69FEXXXXXXXXXXXX"
                        },
                        "YY:YY:YY:YY:YY:YY":    {
                                "rssi": -72,
                                "timestamp":    "1692020328",
                                "data": "0201061BFF99040513DF4E6EC5A603C00194FFC8AA16D17BB4YYYYYYYYYYYY"
                        }
                }
        }
}
I (2194536) http_server: [http_server/4] Json resp: code=200, content_len=429
I (2194544) http_server: [http_server/4] Response: OK
I (2194553) ruuvi_gateway: [main/1] MAIN_TASK_SIG_ON_GET_HISTORY
I (2194559) LEDS: [leds_task/6] LEDS_TASK_SIG_ON_EV_HTTP_POLL_OK
I (2196576) ruuvi_gateway: [main/1] free heap: 109196

Unexpected error keeps appearing.

On the Gateway side, everything looks fine. So, the problem is definitely on the Home Assistant side.
In the screenshot in the first post, you have the IP address 192.168.0.2, but in the next post in logs, you used different IP for the Gateway 192.168.0.201. Is it correct?
If the error continues to appear, try a clean installation of HA with the latest updates.

Hello,

Yes, the Gateway IP was correct in both posts.
I found the main reason for the ‘unexpected error’
 it was a configured integration already (stupid me). After deleting the previous, the integration for the new discovered device works fine. Weird is, that no entries will appear (I have 3 active sensors there), and HA keeps discovering the Gateway again as a new device.

Seems that I need to try with a clean HA, as instructed (been too busy and lazy for that).

1 Like