Interruptor de encendido/apagado de la calefacción en el tablero para un relé ESP8266 junto al termostato de nuestra oficina
Traducido del English por IA ·
Fundador de una pequeña startup de logística, no soy ingeniero, así que pido disculpas de antemano. La oficina de nuestro almacén tiene un termostato de pared antiguo para una calefacción de gas. Quiero poder encender la calefacción desde nuestro panel de Hermetry antes de que llegue la gente, y ver la temperatura de la oficina.Lo que tengo hasta ahora: un Sonoff Basic R2 (ESP8266) que flashé con mi propio sketch de Arduino usando PubSubClient. Envía una temperatura DS18B20 cada minuto a v1/telemetry y esa parte funciona, puedo graficarla. Añadí una tarjeta Switch en el tablero, pero en la configuración, bajo Ejecutar un comando, la lista de comandos del dispositivo está vacía, y cuando probé el cuadro de método sin procesar obtuve «Este comando no está en el catálogo del perfil del dispositivo, por lo que no se puede enviar desde un tablero.»En el sketch me suscribo a v1/rpc/req/+ y alterno GPIO12 cuando method es heat.set. Además, no estoy 100 % seguro de cómo se conecta el Sonoff al cableado del termostato; iba a poner su salida en los dos terminales del termostato.
Founder of a small logistics startup, not an engineer, so apologies in advance. Our warehouse office has an old wall thermostat for a gas heater. I want to be able to switch the heat on from our Hermetry dashboard before people arrive, and see the office temperature.
What I have so far: a Sonoff Basic R2 (ESP8266) that I flashed with my own Arduino sketch using PubSubClient. It sends a DS18B20 temperature every minute to v1/telemetry and that part works, I can chart it. I added a Switch card on the board, but in the settings under Run a command the command list for the device is empty, and when I tried the raw method box I got «This command is not in the device profile’s catalogue, so it cannot be sent from a board.»
In the sketch I subscribe to v1/rpc/req/+ and toggle GPIO12 when method is heat.set. Also I’m not 100% sure how the Sonoff goes into the thermostat wiring, I was going to put its output across the two thermostat terminals.
Traducido del English por IA ·
Siguiendo con esto, quiero hacer algo similar para las salas de reuniones de nuestro hotel.
Following, I want to do something similar for meeting rooms in our hotel.
Traducido del English por IA ·
Deténgase antes de la parte del cableado. Un Sonoff Basic deja pasar la fase de red hacia su salida. Los terminales del termostato de la mayoría de las calderas de gas forman un bucle de baja tensión de petición de calor (call-for-heat). Conectar la salida del Basic a ellos pone 230 V en la placa de control de la caldera. ¿Qué tensión hay en esos dos cables?
Stop before the wiring part. A Sonoff Basic switches mains live through to its output. Thermostat terminals on most gas heaters are a low voltage call-for-heat loop. Putting the Basic’s output across them puts 230 V on the boiler’s control board. What voltage is on those two wires?
Traducido del English por IA ·
Medido, 24 V AC. Así que… menos mal que pregunté.
Measured it, 24 V AC. So… good thing I asked.
Traducido del English por IA ·
Sí, cometí el mismo error en papel el invierno pasado en casa. Necesitas un contacto seco, así que o bien un módulo de relé libre de tensión (la placa tipo Sonoff RE5V1C, o cualquier ESP8266 con un módulo de relé de 5 V conectado a COM/NO) en los terminales del termostato, en paralelo con el termostato antiguo para que siga funcionando si tu placa falla.La parte de la placa fue más fácil de lo que pensaba una vez que encontré el catálogo. Abre el perfil del dispositivo, la pestaña Commands, y pulsa Add command:
Method: heat.set
Label: Heating
Tier: Basic
Parameters: on (Yes / no, required)
Solo los comandos de nivel Basic de esa lista aparecen en la configuración del Switch. Luego, en Switch: Run a command, elige el dispositivo y heat.set, con el valor de «The control’s value». Vincula Current state a una clave de telemetría que reporte la placa: yo envío heat_on como 0/1 con cada lectura para que el interruptor muestre lo que el relé hace realmente, y no lo que pulsaste. Para una luz o calefacción puedes desactivar «Ask before running». Responde con el mismo id o la tarjeta se queda en «Sent; waiting for the device»:
// in callback, topic "v1/rpc/req/17"
String id = String(topic).substring(11);
digitalWrite(RELAY, on ? HIGH : LOW);
mqtt.publish(("v1/rpc/res/" + id).c_str(), "{"ok":true}");
Página que usé: Control cards.
Yep did the same mistake on paper last winter at home. You want a dry contact, so either a relay module that’s volt-free (the Sonoff RE5V1C style board, or any ESP8266 plus a 5 V relay module wired COM/NO) across the thermostat terminals, in parallel with the old thermostat so it still works if your board dies.
The board side was easier than I thought once I found the catalogue. Open the device’s profile, Commands tab, Add command:
Method: heat.set
Label: Heating
Tier: Basic
Parameters: on (Yes / no, required)
Only Basic tier commands from that list show up in the Switch settings. Then in the Switch: Run a command, pick the device and heat.set, value from «The control’s value». Bind Current state to a telemetry key the board reports, I send heat_on as 0/1 with every reading so the switch shows what the relay is really doing, not what you clicked. For a light or heating you can turn «Ask before running» off. Reply on the same id or the card sits on «Sent; waiting for the device»:
// in callback, topic "v1/rpc/req/17"
String id = String(topic).substring(11);
digitalWrite(RELAY, on ? HIGH : LOW);
mqtt.publish(("v1/rpc/res/" + id).c_str(), "{"ok":true}");
Page I used: Control cards.
Traducido del English por IA ·
Conseguí una placa de relés libre de tensión, conectada en paralelo con el termostato antiguo, y añadí heat.set al perfil. El interruptor funciona y muestra el estado real. Lo que me faltaba en el código era la respuesta: sin ella, cada clic indicaba «sin respuesta» tras 30 segundos, aunque la calefacción sí se encendía.
Got a volt-free relay board, wired in parallel with the old thermostat, and added heat.set to the profile. Switch works and shows the real state. The bit I was missing in code was the reply, without it every click said no answer after 30 seconds even though the heater came on.
Traducido del English por IA ·
Mantenga el termostato antiguo ajustado a unos 12 °C como protección anticongelante en paralelo; así, si internet o su placa fallan, el edificio igualmente no se congelará.
Keep the old thermostat set to something like 12 °C as frost protection in parallel, then if the internet or your board is out the building still won’t freeze.
- 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.

