Package: py-aosmith
py-aosmithThis is an API Client for A. O. Smith iCOMM-enabled water heaters. If you can control your
water heater using the A. O. Smith mobile app (iOS/Android), then it should be compatible with this library.Known Compatible ModelsEE9-40R55DVEE9-40H55DVEE9-50R55DVEE9-50H55DVEE12-50R55DVFEE12-50H55DVFEE12-55H55DVFHPS10-50H45DVHPS10-66H45DVHPS10-80H45DVHPSX-50-DHPTHPTS-50HPTS-66HPTS-80HPV10-50H01DVHPV10-66H01DVHPV10-80H01DVIf your water heater is not working with this library, but it can be controlled using the A. O. Smith mobile app, pleaseopen an issueso that support can be added.Similarly, if your water heater is working with this library, but is not listed here, pleaseopen an issueso it can be added to the list.InstallationTo install the latest release fromPyPI, runpip3 install py-aosmith.Quick StartYou will need a compatible water heater which is already connected to Wi-Fi and linked to your A. O. Smith account.This example initializes the API client and gets a list of water heaters linked to the account. Then, for each water heater, it updates the setpoint to 120 degrees.frompy_aosmithimportAOSmithAPIClientfrompy_aosmith.modelsimportOperationMode# Initialize API clientclient=AOSmithAPIClient("myemail@example.com","mypassword")# Get list of water heaters linked to the accountdevices=awaitclient.get_devices()# Loop through the registered water heatersfordeviceindevices:# Update the setpoint to 120 degreesawaitclient.update_setpoint(device.junction_id,120);# Set the operation mode to heat pumpawaitclient.update_mode(device.junction_id,OperationMode.HEAT_PUMP)API DocumentationInitialize API ClientAOSmithAPIClient(email,password)ParametersParameterDescriptionemailThe email address for your A. O. Smith accountpasswordThe password for your A. O. Smith accountReturn valueReturns an instance ofAOSmithAPIClientwhich can be used to invoke the below methods.Get List of Devicesawaitclient.get_devices()Gets a list of water heaters linked with the A. O. Smith account. May only include devices which are known to be compatible with this library.If your water heater can be controlled in the A. O. Smith mobile app, but is not included in the return value of this method, pleaseopen an issueso that support can be added.ParametersNoneReturn value[Device(brand='aosmith',model='HPTS-50 200 202172000',device_type=DeviceType.NEXT_GEN_HEAT_PUMP,dsn='xxxxxxxxxxxxxxx',junction_id='xxxxxxxxxxxxxxxxxx',# Unique ID needed to call the other API methodsname='Water Heater',# Custom nickname assigned to your water heater in the mobile appserial='xxxxxxxxxxxxx',install_location='Basement',# Install location set in the mobile appsupported_modes=[# Available operation modes for your water heaterSupportedOperationModeInfo(mode=OperationMode.HYBRID,# Enum value of the mode (use this when calling update_mode)original_name='HYBRID',# Original name of the mode as returned by the APIhas_day_selection=False# Whether the mode supports day selection),SupportedOperationModeInfo(mode=OperationMode.HEAT_PUMP,original_name='HEAT_PUMP',has_day_selection=False),SupportedOperationModeInfo(mode=OperationMode.ELECTRIC,original_name='ELECTRIC',has_day_selection=True),SupportedOperationModeInfo(mode=OperationMode.VACATION,original_name='VACATION',has_day_selection=True)],status=DeviceStatus(firmware_version='2.14',# Current installed firmware versionis_online=True,# Whether the water heater is currently connected to the internetcurrent_mode=OperationMode.HEAT_PUMP,# Current operation modemode_change_pending=False,# Whether a mode change is currently in progresstemperature_setpoint=145,# Current setpoint (target water temperature)temperature_setpoint_pending=False,# Whether a setpoint change is currently in progresstemperature_setpoint_previous=145,# Previous setpointtemperature_setpoint_maximum=145,# Maximum setpoint (to increase this, manually adjust the setpoint using the buttons on the water heater)hot_water_status=HotWaterStatus.HIGH# Current hot water availability (low, medium, high)))]Update setpointawaitclient.update_setpoint(junction_id,setpoint)Updates the setpoint (target water temperature) of the water heater.When using this method, the setpoint cannot be adjusted above thetemperature_setpoint_maximumfrom the return value ofget_devices(). To increase the maximum, manually adjust the setpoint using the buttons on the water heater.ParametersParameterDescriptionjunction_idUnique ID of the water heater, obtained fromget_devices()setpointNew target temperature to setReturn valueNoneUpdate modeawaitclient.update_mode(junction_id,mode,days)Sets the operation mode of the water heater. To determine the list of modes supported by your water heater, checksupported_modesin theDeviceobject returned byget_devices().ParametersParameterDescriptionjunction_idUnique ID of the water heater, obtained fromget_devices()modeNew operation mode to set. Must be a member of theOperationModeenum and must be a supported mode fromsupported_modes.daysOptional. Number of days after which the device will automatically exit this mode. Only works for modes wherehas_day_selectionfromsupported_modesisTrue.Return valueNoneGet energy use dataawaitclient.get_energy_use_data(junction_id)Gets energy use history data from the water heater.ParametersParameterDescriptionjunction_idUnique ID of the water heater, obtained fromget_devices()Return valueEnergyUseData(lifetime_kwh=234.309,history=[EnergyUseHistoryEntry(date='2023-12-09T04:00:00.000Z',energy_use_kwh=2.19),EnergyUseHistoryEntry(date='2023-12-10T04:00:00.000Z',energy_use_kwh=3.786),EnergyUseHistoryEntry(date='2023-12-11T04:00:00.000Z',energy_use_kwh=5.292),# ...])DisclaimerThis project is not affiliated with or endorsed by A. O. Smith. This is not an official API, and it may stop working at any time without warning.