Ein-/Aus-Schalter für die Heizung im Dashboard für ein ESP8266-Relais neben unserem Büro-Thermostat
Von English mit KI übersetzt ·
Gründer eines kleinen Logistik-Startups, kein Ingenieur, daher vorab um Entschuldigung. Unser Lagerbüro hat einen alten Wandthermostat für eine Gasheizung. Ich möchte die Heizung über unser Hermetry-Dashboard einschalten können, bevor die Leute kommen, und die Büro-Temperatur sehen.Mein bisheriger Stand: ein Sonoff Basic R2 (ESP8266), den ich mit meinem eigenen Arduino-Sketch unter Verwendung von PubSubClient geflasht habe. Er sendet jede Minute eine DS18B20-Temperatur an v1/telemetry, und dieser Teil funktioniert, ich kann sie grafisch darstellen. Ich habe eine Switch-Karte auf dem Board hinzugefügt, aber in den Einstellungen unter Befehl ausführen ist die Befehlsliste für das Gerät leer, und als ich das Feld für die rohe Methode benutzt habe, erhielt ich: „Dieser Befehl ist nicht im Katalog des Geräteprofils enthalten und kann daher nicht von einem Board gesendet werden.“Im Sketch abonniere ich v1/rpc/req/+ und schalte GPIO12 um, wenn method gleich heat.set ist. Außerdem bin ich mir nicht ganz sicher, wie der Sonoff in die Thermostat-Verkabelung eingebunden wird; ich wollte seinen Ausgang an die beiden Thermostatklemmen legen.
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.
Von English mit KI übersetzt ·
Anschließend möchte ich etwas Ähnliches für Besprechungsräume in unserem Hotel umsetzen.
Following, I want to do something similar for meeting rooms in our hotel.
Von English mit KI übersetzt ·
Halten Sie vor dem Verkabelungsteil inne. Ein Sonoff Basic schaltet die Netzphase durch zu seinem Ausgang. Die Thermostatklemmen der meisten Gasheizungen sind ein Niederspannungs-Anforderungskreis (Call-for-Heat). Legt man den Ausgang des Basic daran, liegen 230 V an der Steuerplatine des Heizkessels. Welche Spannung liegt an diesen beiden Drähten an?
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?
Von English mit KI übersetzt ·
Gemessen, 24 V AC. Also… gut, dass ich gefragt habe.
Measured it, 24 V AC. So… good thing I asked.
Von English mit KI übersetzt ·
Ja, den gleichen Fehler habe ich letzten Winter zu Hause auf dem Papier gemacht. Du brauchst einen potentialfreien Kontakt, also entweder ein potentialfreies Relaismodul (wie die Sonoff RE5V1C oder ein beliebiger ESP8266 mit einem 5-V-Relaismodul, verdrahtet an COM/NO) an den Thermostatklemmen, parallel zum alten Thermostat, damit es auch dann funktioniert, wenn deine Platine ausfällt.Die Platinenseite war einfacher als gedacht, sobald ich den Katalog gefunden hatte. Öffne das Geräteprofil, den Reiter Commands, und klicke auf Add command:
Method: heat.set
Label: Heating
Tier: Basic
Parameters: on (Yes / no, required)
Nur Befehle der Stufe Basic aus dieser Liste erscheinen in den Switch-Einstellungen. Dann im Switch: Run a command, Gerät und heat.set auswählen, Wert von „The control’s value“. Bind Current state an einen Telemetrieschlüssel binden, den die Platine meldet. Ich sende heat_on bei jeder Messung als 0/1, damit der Schalter zeigt, was das Relais tatsächlich tut, und nicht, was du geklickt hast. Bei Licht oder Heizung kannst du „Ask before running“ deaktivieren. Antworte mit derselben ID, sonst bleibt die Karte bei „Sent; waiting for the device“ hängen:
// 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}");
Verwendete Seite: 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.
Von English mit KI übersetzt ·
Habe ein potenzialfreies Relaisboard besorgt, parallel zum alten Thermostat verdrahtet und heat.set zum Profil hinzugefügt. Der Schalter funktioniert und zeigt den tatsächlichen Zustand an. Was mir im Code gefehlt hat, war die Antwort. Ohne sie meldete jeder Klick nach 30 Sekunden „keine Antwort“, obwohl die Heizung eingeschaltet war.
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.
Von English mit KI übersetzt ·
Lassen Sie das alte Thermostat parallel etwa auf 12 °C als Frostschutz eingestellt. Wenn dann das Internet oder Ihre Platine ausfällt, friert das Gebäude trotzdem nicht ein.
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.
- Du musst angemeldet sein, um auf dieses Thema antworten zu können.
Mitdiskutieren
Melde dich an, um Fragen zu stellen und zu beantworten, hilfreiche Beiträge mit „Gefällt mir“ zu markieren und die Antwort zu kennzeichnen, die dein Problem gelöst hat. Jeder Beitrag bringt Punkte und Stufen.

