Added ETOP HT-08 Thermostat and HT-10 TRV (#4491)

* Added ETOP HT-08 Thermostat

References:
* https://github.com/Koenkk/zigbee2mqtt/issues/4185
* https://github.com/Koenkk/zigbee2mqtt/issues/1856
* https://github.com/Koenkk/zigbee2mqtt/issues/4486
* http://www.etopcontrols.com/thermostat/detail/HT-08.html

* Rename `away` to `away_mode`

* Added ETOP HT-10 TRV
Minor fixes for HT-08

References:
* https://github.com/Koenkk/zigbee2mqtt/issues/1856
* http://www.etopcontrols.com/thermostat/detail/HT-10.html
This commit is contained in:
Hacker-CB 2020-09-30 20:52:11 +03:00 committed by GitHub
parent d5d7d076a7
commit 44224b4d6b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -861,11 +861,26 @@ const climate = (minTemp=7, maxTemp=30, temperatureStateProperty='occupied_heati
}
// hold_modes empty <=> don't use presets
if (holdModes.length > 0) {
// NOTE: Preset 'none' will be added as first item on HA side `mqtt/climate.py preset_modes()`
const indexOfNone = holdModes.indexOf('none');
if (indexOfNone > -1) holdModes.splice(indexOfNone, 1);
// HA has special behaviour for the away mode
const indexOfAway = holdModes.indexOf('away');
if (indexOfAway > -1) {
holdModes.splice(indexOfAway, 1); // HA will add "Away" to modes by itself
retVal.discovery_payload.away_mode_command_topic = true;
retVal.discovery_payload.away_mode_state_topic = true;
retVal.discovery_payload.away_mode_state_template =
'{{ value_json.away_mode }}';
}
if (holdModes.length > 0 || indexOfAway > -1) {
retVal.discovery_payload.hold_modes = holdModes;
retVal.discovery_payload.hold_command_topic = true;
retVal.discovery_payload.hold_state_template = `{{ value_json.preset }}`;
retVal.discovery_payload.hold_state_topic = true;
}
}
// fan_modes empty <=> don't use fan modes
if (fanModes.length > 0) {
retVal.discovery_payload.fan_modes = fanModes;
@ -1842,6 +1857,16 @@ const mapping = {
climate(5, 30, 'current_heating_setpoint', 0.5, [], [],
['schedule', 'manual', 'away', 'boost', 'complex', 'comfort', 'eco']),
],
'HT-08': [
cfg.lock_child_lock,
climate(5, 35, 'current_heating_setpoint', 0.5,
['off', 'heat', 'auto'], [], ['none', 'away']),
],
'HT-10': [
cfg.lock_child_lock, cfg.binary_sensor_battery_low,
climate(5, 35, 'current_heating_setpoint', 0.5,
['off', 'heat', 'auto'], [], ['none', 'away']),
],
'WXKG07LM': [cfg.sensor_action, cfg.sensor_battery],
'MCLH-03': [cfg.switch, cfg.sensor_voltage, cfg.sensor_power, cfg.sensor_current],
'752189': [cfg.sensor_action, cfg.sensor_battery],
@ -2363,6 +2388,14 @@ class HomeAssistant extends Extension {
payload.hold_state_topic = stateTopic;
}
if (payload.away_mode_state_topic) {
payload.away_mode_state_topic = stateTopic;
}
if (payload.away_mode_command_topic) {
payload.away_mode_command_topic = `${stateTopic}/set/away_mode`;
}
if (payload.current_temperature_topic) {
payload.current_temperature_topic = stateTopic;
}