Nodos ESP8266 en las habitaciones, una Pi en medio, Hermetry encima: ¿diseño razonable?
Traducido del English por IA ·
Hola. Administro una casa de huéspedes de 12 habitaciones y soy nuevo en todo esto, así que tenga paciencia conmigo.Quiero sensores de temperatura, humedad y puerta en cada habitación, además de la temperatura del calentador de agua (geyser). Mi sobrino sugirió esta disposición y me gustaría saber si es sensata antes de comprar todo:
ESP8266 node per room (DHT22 + reed switch)
| Wi-Fi, MQTT
Raspberry Pi 4 in the office (Mosquitto + Node-RED)
| internet
Hermetry (dashboards, alarms to my phone)
Casi todas las semanas tenemos cortes de carga (load shedding), así que internet se cae de 2 a 4 horas cada vez. No quiero perder lecturas durante esos cortes. Más adelante quizá quiera apagar los calentadores desde el panel. ¿Es viable y flexible, o la Pi en medio es un error?
Hello. I manage a guest house, 12 rooms, and I’m new to all of this, so please be patient with me.
I want temperature, humidity and door sensors in each room, plus a geyser temperature. My nephew suggested this layout and I’d like to know if it is sensible before I buy everything:
ESP8266 node per room (DHT22 + reed switch)
| Wi-Fi, MQTT
Raspberry Pi 4 in the office (Mosquitto + Node-RED)
| internet
Hermetry (dashboards, alarms to my phone)
We get load shedding most weeks, so the internet goes down for 2 to 4 hours at a time. I don’t want to lose readings then. Later I may want to switch the geysers off from the dashboard. Is this feasible and flexible, or is the Pi in the middle a mistake?
Traducido del English por IA ·
Factible. Eso sí, conecta la Pi y el router a un pequeño SAI (UPS); si no, la Pi no te sirve de nada durante los cortes de carga.
Feasible. Put the Pi and the router on a small UPS though, otherwise the Pi buys you nothing during load shedding.
Traducido del English por IA ·
Tenemos algo casi igual en unas cuantas estaciones de bombeo pequeñas, así que le comento un par de cosas.El Pi en medio es buena idea por sus cortes. Haga que actúe como pasarela: un dispositivo en Hermetry marcado como «This device is a gateway», y cada habitación se convierte en un dispositivo hijo la primera vez que el Pi la reporta. Node-RED recoge los mensajes de las habitaciones desde Mosquitto, los guarda en un archivo o en una pequeña tabla SQLite mientras no hay internet, y luego los envía con sus propias marcas de tiempo:
topic v1/gw/telemetry
{"Room 4": [{"ts": 1793000000000, "values": {"temperature": 22.1, "humidity": 51, "door_open": 0}},
{"ts": 1793000300000, "values": {"temperature": 22.0, "humidity": 51, "door_open": 1}}]}
Asegúrese de que el Pi tenga la hora correcta (NTP tras el arranque) antes de poner un ts en cualquier dato. Una cola grande se vacía un poco más despacio porque las reproducciones tienen su propio límite de velocidad en el perfil; es normal.El control del calentador de agua puede pasar por el mismo Pi. Un comando enviado a un dispositivo hijo llega a su pasarela por v1/gw/rpc, así que Node-RED se suscribe a ese topic y lo reenvía a la habitación correcta. O bien haga del controlador del calentador un dispositivo propio que se conecte directamente a Hermetry. Para un calentador, yo iría directo, con menos piezas móviles.Los topics de pasarela están descritos en Devices behind a gateway.
We run nearly this at a few small pump stations, so a couple of things from that.
The Pi in the middle is a good call because of your outages. Have it act as a gateway: one device in Hermetry marked «This device is a gateway», and each room becomes a child device the first time the Pi reports it. Node-RED collects the room messages from Mosquitto, keeps them in a file or a small SQLite table while the internet is down, and then sends them on with their own timestamps:
topic v1/gw/telemetry
{"Room 4": [{"ts": 1793000000000, "values": {"temperature": 22.1, "humidity": 51, "door_open": 0}},
{"ts": 1793000300000, "values": {"temperature": 22.0, "humidity": 51, "door_open": 1}}]}
Make sure the Pi has the right time (NTP after boot) before you put a ts on anything. A big backlog drains a bit slower because replays have their own rate limit on the profile, that’s normal.
Geyser switching can go through the same Pi. A command sent to a child device comes down to its gateway on v1/gw/rpc, so Node-RED subscribes to that and passes it on to the right room. Or make the geyser controller its own device that connects to Hermetry directly. For a geyser I’d go direct, fewer moving parts.
Gateway topics are described in Devices behind a gateway.
Traducido del English por IA ·
Gracias a los dos. Compré el SAI, el Pi lleva dos semanas funcionando como pasarela. El martes pasado hubo un corte de 4 horas y las gráficas de las habitaciones se completaron después sin ningún hueco. El primer intento creaba un perfil «Generic child» para cada habitación; luego aprendí a enviar un «type» al conectarse. El controlador del calentador de agua será un dispositivo independiente.
Thank you both. Bought the UPS, the Pi has been running as the gateway for two weeks. Last Tuesday we had 4 hours off and the room charts filled in afterwards with no gap. The first try made a «Generic child» profile for every room, then I learned to send a «type» on connect. The geyser controller will be its own device.
- Debes estar registrado para responder a este debate.
Únete a la conversación
Inicia sesión para preguntar y responder, dar me gusta a las publicaciones útiles y marcar la respuesta que resolvió tu problema. Cada aportación suma puntos y niveles.

