Repository navigation
HOMEd
English · Русский
OTGateway connects to HOMEd through MQTT and the HOMEd Custom service. The device template adds heating and DHW controls, controller settings, states and sensor readings.
The template supports current OTGateway firmware with separate MQTT topics for each value. It uses metric units: °C, L/min, bar and kW.
- Connect HOMEd Custom and OTGateway to the same MQTT broker. In OTGateway, open Settings → MQTT settings, enable MQTT and save.
- Download the import file: otgateway.json.
- Replace every occurrence of
<prefix>with the prefix from your OTGateway MQTT settings, includingavailabilityTopic. Use uniqueidandnamevalues if adding several devices. - Open HOMEd Web in a desktop browser, select the appropriate Custom service, click Import and select the edited file. Import adds the device immediately. Keep
real: trueto enable bindings. - Wait at least 30 seconds after OTGateway connects to the broker, then check the states and readings in HOMEd.
The downloaded file describes one device. To edit the HOMEd Custom database manually, stop the service and back up its database. Add the full template object to the existing devices array, save the file and start the service. The default database path is /opt/homed-custom/database.json; the service configuration may specify another path. Preserve the other devices in the array.
| Group | Controls and readings |
|---|---|
| Heating | Enable, target, flow temperature limits, Turbo and hysteresis |
| DHW | Enable, target and temperature limits |
| PID | Enable, gains, calculation interval, output limits and deadband |
| Weather compensation | Enable, heating curve slope, exponent, shift and indoor temperature correction |
| State | OpenTherm connection, circuit and cooling activity, flame, heating blocking, protections, emergency mode, pump and cascade control |
| Diagnostics | Fault and diagnostic flags, codes and reset buttons, ESP32 uptime and restart |
| Readings | Default sensors, indoor sensor connection, combined indoor and outdoor temperatures, calculated heating setpoint |
Protection thresholds, modulation caps, the emergency target and sensor aggregation are configured in the OTGateway web interface.
Device availability uses <prefix>/status: online means the ESP32 is connected to the broker. The separate openthermConnectionState indicator shows the connection to the Slave device. Sensor and circuit functions also depend on support from the Slave device.
heatingEnabled shows the saved setting, heatingRequested shows the circuit permission calculated by OTGateway, and heatingActive shows the activity reported by the Slave device. The corresponding DHW properties are dhwEnabled, dhwRequested and dhwActive.
| HOMEd property | Purpose |
|---|---|
heatingEnabled |
Enable the heating circuit |
heatingTargetTemperature |
Indoor target with PID, weather compensation or the Slave device's native weather compensation; otherwise the flow temperature target |
heatingMinTemperature |
Lower heating flow temperature limit |
heatingMaxTemperature |
Upper heating flow temperature limit |
heatingTurbo |
Enable Turbo for PID or weather compensation |
heatingHysteresisEnabled |
Enable heating hysteresis |
heatingHysteresis |
Indoor temperature deviation used to pause and resume heating |
dhwEnabled |
Enable the DHW circuit |
dhwTargetTemperature |
DHW target temperature |
dhwMinTemperature |
Lower DHW target limit |
dhwMaxTemperature |
Upper DHW target limit |
pidEnabled |
Enable PID |
pidPFactor |
Proportional gain |
pidIFactor |
Integral gain |
pidDFactor |
Derivative gain |
pidDt |
PID calculation interval, seconds |
pidMinTemperature |
Lower PID output limit |
pidMaxTemperature |
Upper PID output limit |
pidDeadbandEnabled |
Enable separate gain multipliers near the indoor target |
pidDeadbandPMultiplier |
Proportional gain multiplier inside the deadband |
pidDeadbandIMultiplier |
Integral gain multiplier inside the deadband |
pidDeadbandDMultiplier |
Derivative gain multiplier inside the deadband |
pidDeadbandThresholdHigh |
Deadband width above the indoor target |
pidDeadbandThresholdLow |
Deadband width below the indoor target |
equithermEnabled |
Enable weather compensation |
equithermSlope |
Heating curve slope |
equithermExponent |
Heating curve exponent |
equithermShift |
Heating curve temperature offset |
equithermTargetDiffFactor |
Correction factor for the difference between the indoor target and measured temperature |
heatingSetpointTemperature |
Calculated flow temperature setpoint, read only |
OTGateway validates changes and publishes the accepted settings back to HOMEd. Circuit temperature limits also respect the Slave device's limits.
pidMinTemperature and pidMaxTemperature use whole numbers. With PID alone, they limit the flow temperature; with weather compensation, they limit the correction to the heating curve. A negative lower limit applies only with weather compensation.
Controller settings are described in the heating documentation. Protection thresholds, modulation caps, the emergency target and sensor aggregation are configured in the OTGateway web interface.
Important
If you switch OTGateway to imperial units, adapt the template's units, numeric ranges and steps. Changing a °C label to °F alone is insufficient.
The template uses the default OTGateway sensor names.
| OTGateway sensor | HOMEd reading | Enabled by default |
|---|---|---|
| Outdoor temp | outdoorTemperature |
No |
| Indoor temp | indoorTemperature |
No |
| Heating temp | heatingCurrentTemperature |
Yes |
| Heating return temp | heatingReturnTemperature |
Yes |
| Heating setpoint temp | heatingSetpointTemperature |
Yes |
| DHW temp | dhwCurrentTemperature |
Yes |
| DHW flow rate | dhwFlowRate |
Yes |
| Exhaust temp | exhaustTemperature |
Yes |
| Pressure | pressure |
Yes |
| Modulation level | modulationLevel |
Yes |
| Power | power |
Yes |
heatingSetpointTemperature reads OTGateway's calculated setpoint directly and does not depend on the named Heating setpoint temp sensor being enabled.
For example, indoorTemperature = 21.5 and indoorTemperatureConnected = true mean that the indoor sensor is connected and reads 21.5 °C. When indoorTemperatureConnected = false, HOMEd may retain the last number. The other sensors' readings and connection states can be viewed on the OTGateway Dashboard. An OpenTherm connection does not guarantee that the Slave device supports or provides every measurement.
Indoor temp and Outdoor temp are disabled by default. In the OTGateway sensor settings, enable the sensor and select its source and purpose. For example, for a room DS18B20, select Dallas, specify the GPIO and choose Indoor temperature. After saving, check its reading and connection on the OTGateway Dashboard and in HOMEd.
Zero modulation is valid while the flame is on. flameState shows burner operation.
When several sensors share a purpose, OTGateway combines their readings. The template shows the indoor and outdoor temperatures used for heating control separately from individual sensor readings.
| HOMEd property | Reading |
|---|---|
heatingIndoorTemperature |
Indoor temperature used for heating control |
heatingOutdoorTemperature |
Outdoor temperature used for heating control |
For example, 2 connected room sensors read 20 and 22 °C. If both have the Indoor temperature purpose, the result in heatingIndoorTemperature depends on the aggregation method selected in the OTGateway web interface under Heating settings:
| Selection | Result |
|---|---|
mean |
21 °C |
minimum |
20 °C |
maximum |
22 °C |
The outdoor temperature aggregation method is set separately in the same settings.
Only connected sensors contribute to the calculation. If no sources with the required purpose remain, the combined temperature becomes 0. The participating sensors' connection states are shown in OTGateway. The number 0 alone cannot distinguish a missing source from an actual reading.
A sensor's MQTT address depends on its name. For example, renaming Indoor temp to Living room changes its slug from indoor_temp to living_room. Update 2 fields in the HOMEd device definition's bindings object:
| Property | New inTopic value |
|---|---|
indoorTemperature |
<prefix>/sensors/living_room/value |
indoorTemperatureConnected |
<prefix>/sensors/living_room/connected |
You can keep the HOMEd property names so existing automations continue to use indoorTemperature. OTGateway reports the current slug in its sensor REST API.
Dallas, NTC, OpenTherm and MANUAL sensors publish temperature at /value. Bluetooth, DHT11 and DHT22 sensors use /temperature. If Living room uses Bluetooth, set indoorTemperature to read <prefix>/sensors/living_room/temperature. The connection topic stays <prefix>/sensors/living_room/connected.
Save the updated definition in HOMEd and compare the reading with the OTGateway Dashboard. The combined heatingIndoorTemperature property continues to work after a source is renamed because it depends on the sensor's purpose.
Bluetooth, DHT11 and DHT22 sensors also provide humidity. For example, to add humidity from Living room to the HOMEd device definition, append indoorHumidity to the existing exposes array and add entries with the same name to options and bindings. Only the new entries are shown below:
{
"exposes": ["indoorHumidity"],
"options": {
"indoorHumidity": {
"type": "sensor",
"class": "humidity",
"state": "measurement",
"unit": "%",
"round": 1
}
},
"bindings": {
"indoorHumidity": {
"inTopic": "<prefix>/sensors/living_room/humidity",
"inPattern": "{{ value if value is number else _NULL_ }}"
}
}
}Preserve the device's other properties. The same indoorTemperatureConnected indicator shows the connection to the humidity source.
This method applies when the indoor or outdoor sensor is already connected to HOMEd, for example through Zigbee. This example uses the default Indoor temp name; a renamed sensor uses its new slug.
- In the OTGateway sensor settings, select Indoor temp.
- Select Manual via MQTT/API, choose the Indoor temperature purpose, enable the sensor and save. The Temperature purpose displays a number but does not include it in heating control.
- Configure HOMEd to send the source temperature to
<prefix>/sensors/indoor_temp/value/set. Send only a number in OTGateway's units, such as21.5, with retain disabled. - Repeat the transmission every 1–5 minutes, including while the temperature is unchanged. After 10 minutes without updates, OTGateway considers a MANUAL sensor disconnected.
- After transmission, check
indoorTemperature = 21.5,indoorTemperatureConnected = trueand the combinedheatingIndoorTemperature. If there is only one indoor source, the combined temperature should match it.
For example, a Zigbee sensor in HOMEd has the address zigbee/roomThermometer and the temperature property. The following automation sends its temperature whenever the reading changes and at 1-minute intervals. It checks service and sensor availability, a numeric temperature and the time of the sensor's last message.
{
"active": true,
"mode": "single",
"name": "Room temperature to OTGateway",
"triggers": [
{
"type": "property",
"endpoint": "zigbee/roomThermometer",
"property": "temperature",
"updates": true
},
{
"type": "interval",
"interval": 1
}
],
"conditions": [
{
"type": "mqtt",
"topic": "homed/service/zigbee",
"property": "status",
"equals": "online"
},
{
"type": "mqtt",
"topic": "homed/device/zigbee/roomThermometer",
"property": "status",
"equals": "online"
},
{
"type": "pattern",
"pattern": "{{ true if {{ property | zigbee/roomThermometer | temperature }} is number else false }}",
"equals": true
},
{
"type": "pattern",
"pattern": "{{ true if {{ mqtt | homed/device/zigbee/roomThermometer | lastSeen }} is number else false }}",
"equals": true
},
{
"type": "pattern",
"pattern": "[[ {{ timestamp }} - {{ mqtt | homed/device/zigbee/roomThermometer | lastSeen }} ]]",
"between": [0, 300]
}
],
"actions": [
{
"type": "mqtt",
"topic": "<prefix>/sensors/indoor_temp/value/set",
"message": "{{ property | zigbee/roomThermometer | temperature }}",
"retain": false
}
]
}Replace <prefix> with the OTGateway prefix and every source address with your sensor's address. The example uses the default HOMEd prefix homed and the zigbee service without an instance name. The device state topic must match your HOMEd MQTT topic structure, including the use of device IDs or names.
Save the example as a JSON file. In HOMEd Web, select Automation → Import, open the file and save the automation. This requires the HOMEd Automation service. In this example, the source and OTGateway use °C; different units require temperature conversion.
The 300 threshold means 5 minutes since the source's last message. Its value depends on the sensor's update interval. lastSeen reflects communication with the device, so the example assumes a source that regularly sends current temperature readings. If the source becomes unavailable or stops reporting, forwarding stops; 10 minutes after the last transmission, OTGateway marks the MANUAL sensor as disconnected. The automation fields are described in the HOMEd documentation.
Outdoor temperature uses Outdoor temp, the Outdoor temperature purpose and the <prefix>/sensors/outdoor_temp/value/set topic. Several HOMEd sources require a separate OTGateway MANUAL sensor for each source: sending different readings to one slot preserves only the last one.
The faultReset and diagReset buttons request a reset. OTGateway processes the request when the Slave device is in a suitable state. The result appears in faultState, diagState, faultCode and diagCode after the next update. Code 0 is preserved as a number.
The restart button schedules an ESP32 restart in 15 seconds.
We recommend deleting the old template completely and adding the new one. Keeping the existing device's id and name is recommended but optional.