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.

