(Post Edited)
Found out that the Climate button didnt really worked (unable to set preset_mode on
generic Zwave climate controller and on Sensibo), Not sure if it was done for a specific controller.
Modifications i have done to support a more generic way:
main.js:
$scope.climateFanSpeed = function (item, entity) {
var value = entity.attributes.fan_mode;
return value;
};
$scope.setClimateFanMode = function ($event, item, entity, option) {
$event.preventDefault();
$event.stopPropagation();
sendItemData(item, {
type: "call_service",
domain: "climate",
service: "set_fan_mode",
service_data: {
entity_id: item.id,
fan_mode: option
}
});
$scope.closeActiveSelect();
return false;
};
$scope.setClimateMode = function ($event, item, entity, option) {
$event.preventDefault();
$event.stopPropagation();
sendItemData(item, {
type: "call_service",
domain: "climate",
service: "set_hvac_mode",
service_data: {
entity_id: item.id,
hvac_mode: option
}
});
$scope.closeActiveSelect();
return false;
};
on the index.html
<div ng-if="item.type === TYPES.CLIMATE"
class="item-entity-container">
<div>
<div class="item-button -center-right"
ng-if="entity.attributes.temperature && entity.state !== 'off'"
ng-click="increaseClimateTemp($event, item, entity)">
<i class="mdi mdi-arrow-up-bold"></i>
</div>
<div class="item-button -bottom-right"
ng-if="entity.attributes.temperature && entity.state !== 'off'"
ng-click="decreaseClimateTemp($event, item, entity)">
<i class="mdi mdi-arrow-down-bold"></i>
</div>
</div>
<!-- Climate Mode -->
<div class="item-climate">
<div class="item-climate--mode" ng-if="entity.attributes.temperature"
ng-click="openSelect(item)">
<span ng-bind="climateTarget(item, entity)"></span>
<span ng-if="(_unit = entityUnit(item, entity))"
class="item-climate--target--unit" ng-bind="_unit"></span>
</div>
<div ng-if="selectOpened(item)" class="item-select"
ng-style="itemSelectStyles(entity, entity.attributes.hvac_modes)">
<div class="item-select--option"
ng-repeat="option in entity.attributes.hvac_modes track by $index"
ng-class="{'-active': option === entity.state}"
ng-click="setClimateMode($event, item, entity, option)">
<span ng-bind="option"></span>
</div>
</div>
</div>
<!-- Climate Fan Mode -->
<div class="item-climate--mode" ng-if="entity.attributes.temperature"
ng-click="openSelect(seconditem)">
<span ng-bind="entity.attributes.fan_mode"></span>
</div>
<div ng-if="selectOpened(seconditem)" class="item-select"
ng-style="itemSelectStyles(entity, entity.attributes.fan_modes)">
<div class="item-select--option"
ng-repeat="option in entity.attributes.fan_modes track by $index"
ng-class="{'-active': option === entity.attributes.fan_mode}"
ng-click="setClimateFanMode($event, item, entity, option)">
<span ng-bind="option"></span>
</div>
</div>
</div>
To-Do (If Possible, New to This…)
Rather having a list, It would be nice to do it as Alarm Button
since mdi icons available for all AC Modes, And AC Speeds.