Traduit de English par IA ·
Oui, j’ai fait la même erreur sur le papier l’hiver dernier chez moi. Il te faut un contact sec, donc soit un module relais sans tension (le type Sonoff RE5V1C, ou n’importe quel ESP8266 avec un module relais 5 V câblé en COM/NO) aux bornes du thermostat, en parallèle avec l’ancien thermostat pour qu’il fonctionne encore si ta carte tombe en panne.La partie carte a été plus simple que je ne le pensais une fois que j’ai trouvé le catalogue. Ouvre le profil de l’appareil, l’onglet Commands, puis Add command :
Method: heat.set
Label: Heating
Tier: Basic
Parameters: on (Yes / no, required)
Seules les commandes de niveau Basic de cette liste apparaissent dans les paramètres du Switch. Ensuite, dans Switch : Run a command, choisis l’appareil et heat.set, avec la valeur « The control’s value ». Lie Current state à une clé de télémétrie que la carte envoie : j’envoie heat_on en 0/1 avec chaque mesure, pour que le switch affiche ce que le relais fait réellement et non ce que tu as cliqué. Pour une lumière ou un chauffage, tu peux désactiver « Ask before running ». Réponds avec le même id, sinon la carte reste bloquée sur « 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 que j’ai utilisée : 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.

