Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

4 additional thermostat attributes #122

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 13 additions & 2 deletions custom_components/daikinskyport/climate.py
Original file line number Diff line number Diff line change
Expand Up @@ -571,7 +571,8 @@ def extra_state_attributes(self):
heatpump_demand = "Unavailable"
dehumidification_demand = "Unavailable"
humidification_demand = "Unavailable"

indoor_mode = "Unavailable"

if "ctAHCurrentIndoorAirflow" in self.thermostat:
if self.thermostat["ctAHCurrentIndoorAirflow"] == 65535:
fan_cfm = self.thermostat["ctIFCIndoorBlowerAirflow"]
Expand All @@ -596,6 +597,11 @@ def extra_state_attributes(self):
if "ctAHHumidificationRequestedDemand" in self.thermostat:
humidification_demand = round(self.thermostat["ctAHHumidificationRequestedDemand"] / 2, 1)

if self.thermostat["ctAHUnitType"] != 255:
indoor_mode=self.thermostat["ctAHMode"].strip()
elif self.thermostat["ctIFCUnitType"] != 255:
indoor_mode=self.thermostat["ctIFCOperatingHeatCoolMode"].strip()

return {
"fan": self.fan,
"schedule_mode": self.thermostat["schedEnabled"],
Expand All @@ -608,9 +614,14 @@ def extra_state_attributes(self):
"humidification_demand": humidification_demand,
"thermostat_version": self.thermostat["statFirmware"],
"night_mode_active": self.thermostat["nightModeActive"],
"night_mode_enabled": self.thermostat["nightModeEnabled"]
"night_mode_enabled": self.thermostat["nightModeEnabled"],
"indoor_mode": indoor_mode,
"outdoor_mode": self.thermostat["ctOutdoorMode"].strip(),
"thermostat_unlocked": bool(self.thermostat["displayLockPIN"] == 0),
"media_filter_days": self.thermostat["alertMediaAirFilterDays"]
}


def set_preset_mode(self, preset_mode):
"""Activate a preset."""
if preset_mode == self.preset_mode:
Expand Down
4 changes: 2 additions & 2 deletions custom_components/daikinskyport/switch.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ def turn_on(self, **kwargs: Any) -> None:
send_command = self.data.daikinskyport.set_hvac_mode(self._index, DAIKIN_HVAC_MODE_AUXHEAT)
if send_command:
self.aux_on = True
self.async_write_ha_state()
self.schedule_update_ha_state()
else:
raise HomeAssistantError(f"Error {send_command}: Failed to turn on {self._name}")

Expand All @@ -68,7 +68,7 @@ def turn_off(self, **kwargs: Any) -> None:
if self.data.daikinskyport.get_thermostat(self._index)['mode'] == DAIKIN_HVAC_MODE_AUXHEAT:
self.data.daikinskyport.set_hvac_mode(self._index, DAIKIN_HVAC_MODE_HEAT)
self.aux_on = False
self.async_write_ha_state()
self.schedule_update_ha_state()

@property
def device_info(self) -> DeviceInfo:
Expand Down