diff --git a/src/components/state-history-chart-line.html b/src/components/state-history-chart-line.html index 873d1accb4..dcbe6b73a0 100644 --- a/src/components/state-history-chart-line.html +++ b/src/components/state-history-chart-line.html @@ -182,6 +182,41 @@ }; } + states.forEach(processState); + } else if (domain === 'climate') { + // We differentiate between thermostats that have a target temperature + // range versus ones that have just a target temperature + hasTargetRange = states.reduce( + function (cum, cur) { + return cum || cur.attributes.target_temp_high !== cur.attributes.target_temp_low; + }, false); + + dataTable.addColumn('number', name + ' current temperature'); + + if (hasTargetRange) { + dataTable.addColumn('number', name + ' target temperature high'); + dataTable.addColumn('number', name + ' target temperature low'); + + noInterpolations = [false, true, true]; + + processState = function (state) { + var curTemp = saveParseFloat(state.attributes.current_temperature); + var targetHigh = saveParseFloat(state.attributes.target_temp_high); + var targetLow = saveParseFloat(state.attributes.target_temp_low); + pushData([state.lastUpdatedAsDate, curTemp, targetHigh, targetLow], noInterpolations); + }; + } else { + dataTable.addColumn('number', name + ' target temperature'); + + noInterpolations = [false, true]; + + processState = function (state) { + var curTemp = saveParseFloat(state.attributes.current_temperature); + var target = saveParseFloat(state.attributes.temperature); + pushData([state.lastUpdatedAsDate, curTemp, target], noInterpolations); + }; + } + states.forEach(processState); } else { dataTable.addColumn('number', name); diff --git a/src/more-infos/more-info-climate.html b/src/more-infos/more-info-climate.html new file mode 100644 index 0000000000..58aeb34c4b --- /dev/null +++ b/src/more-infos/more-info-climate.html @@ -0,0 +1,300 @@ + + + + + + + + + + + + + + + + + + + Target Temperature + + + + + + + + Target Humidity + + + + + + + + + + + [[item]] + + + + + + + + + + + [[item]] + + + + + + + + + + [[item]] + + + + + + + + Away Mode + + + + + + + + Aux Heat + + + + + + + + + diff --git a/src/more-infos/more-info-content.html b/src/more-infos/more-info-content.html index 314a73815f..a7fc613976 100644 --- a/src/more-infos/more-info-content.html +++ b/src/more-infos/more-info-content.html @@ -1,5 +1,6 @@ + diff --git a/src/state-summary/state-card-climate.html b/src/state-summary/state-card-climate.html new file mode 100644 index 0000000000..04337423d4 --- /dev/null +++ b/src/state-summary/state-card-climate.html @@ -0,0 +1,65 @@ + + + + + + + + + + + + + + + [[computeTargetTemperature(stateObj)]] + + + Currently: + [[stateObj.attributes.current_temperature]] + + [[stateObj.attributes.unit_of_measurement]] + + + + + + + diff --git a/src/state-summary/state-card-content.html b/src/state-summary/state-card-content.html index ae439d4d93..3ae10b07e0 100644 --- a/src/state-summary/state-card-content.html +++ b/src/state-summary/state-card-content.html @@ -1,5 +1,6 @@ + diff --git a/src/util/hass-util.html b/src/util/hass-util.html index 19d167f31c..f33c225e34 100644 --- a/src/util/hass-util.html +++ b/src/util/hass-util.html @@ -11,6 +11,7 @@ window.hassUtil.DEFAULT_ICON = 'mdi:bookmark'; window.hassUtil.OFF_STATES = ['off', 'closed', 'unlocked']; window.hassUtil.DOMAINS_WITH_CARD = [ + 'climate', 'configurator', 'hvac', 'input_select', @@ -24,7 +25,7 @@ window.hassUtil.DOMAINS_WITH_CARD = [ ]; window.hassUtil.DOMAINS_WITH_MORE_INFO = [ - 'light', 'group', 'sun', 'configurator', 'thermostat', 'script', + 'light', 'group', 'sun', 'climate', 'configurator', 'thermostat', 'script', 'media_player', 'camera', 'updater', 'alarm_control_panel', 'lock', 'hvac', ]; @@ -200,6 +201,9 @@ window.hassUtil.domainIcon = function (domain, state) { case 'camera': return 'mdi:video'; + case 'climate': + return 'mdi:nest-thermostat'; + case 'configurator': return 'mdi:settings';