simbaja / gehome

Python SDK for GE smart appliances
MIT License
42 stars 29 forks source link

Add code for Geospring Water Heaters #43

Closed seantibor closed 2 years ago

seantibor commented 2 years ago

Added code for my geospring water heater. Could not find documentation for the ERD codes, so I used the websocket example to watch for state changes as I updated settings on the heater. Feedback welcome

2022-08-29 12:30:44,315 DEBUG    Received features [] for D828C901A920
2022-08-29 12:30:44,323 DEBUG    < TEXT '{"kind":"websocket#api","id":"D828C901A920-allE...8-28T12:48:48.775Z"}]}}' [2185 bytes]
2022-08-29 12:30:44,324 DEBUG    Setting ErdCode.MODEL_NUMBER to GEH50DFEJSRA
2022-08-29 12:30:44,324 DEBUG    Setting ErdCode.SERIAL_NUMBER to MF603716G
2022-08-29 12:30:44,324 DEBUG    Setting ErdCode.TEMPERATURE_UNIT to ErdMeasurementUnits.IMPERIAL
2022-08-29 12:30:44,324 DEBUG    Setting ErdCode.APPLIANCE_TYPE to ErdApplianceType.WATER_HEATER
2022-08-29 12:30:44,324 DEBUG    Setting ErdCode.WIFI_MODULE_SW_VERSION to 0.0.2.226
2022-08-29 12:30:44,324 DEBUG    Setting ErdCode.WIFI_MODULE_SW_VERSION_AVAILABLE to 0.0.0.0
2022-08-29 12:30:44,324 DEBUG    Setting ErdCode.ACM_UPDATING to False
2022-08-29 12:30:44,324 DEBUG    Setting ErdCode.APPLIANCE_SW_VERSION to 1.0.6.7
2022-08-29 12:30:44,324 DEBUG    Setting ErdCode.APPLIANCE_SW_VERSION_AVAILABLE to 1.0.6.7
2022-08-29 12:30:44,324 DEBUG    Setting ErdCode.APPLIANCE_UPDATING to False
2022-08-29 12:30:44,324 DEBUG    Setting ErdCode.WH_HEATER_MODE to ErdWaterHeaterMode.HYBRID
2022-08-29 12:30:44,324 DEBUG    Setting ErdCode.WH_HEATER_UNKNOWN4021 to b'\x01'
2022-08-29 12:30:44,324 DEBUG    Setting ErdCode.WH_HEATER_UNKNOWN4022 to b'\x00'
2022-08-29 12:30:44,324 DEBUG    Setting ErdCode.WH_HEATER_UNKNOWN4023 to b'\x00'
2022-08-29 12:30:44,324 DEBUG    Setting ErdCode.WH_HEATER_TARGET_TEMPERATURE to ErdWaterHeaterTargetTemperature(temperature=135.0)
2022-08-29 12:30:44,324 DEBUG    Setting ErdCode.WH_HEATER_UNKNOWN4025 to b'\x01\xf4'
2022-08-29 12:30:44,324 DEBUG    Setting ErdCode.WH_HEATER_SET_TEMPERATURE to ErdWaterHeaterSetTemperature(temperature=135.0)
2022-08-29 12:30:44,325 DEBUG    Setting ErdCode.WH_HEATER_MODE_HOURS_REMAINING to 7 days, 0:00:00
2022-08-29 12:30:44,325 DEBUG    Setting ErdCode.WH_HEATER_UNKNOWN4040 to b'\x1f'
2022-08-29 12:30:44,325 DEBUG    Setting ErdCode.WH_HEATER_UNKNOWN4041 to b'2'
2022-08-29 12:30:44,325 DEBUG    Setting ErdCode.WH_HEATER_UNKNOWN4046 to b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'
2022-08-29 12:30:44,325 DEBUG    Setting ErdCode.WH_HEATER_UNKNOWN4047 to b'\x03\xe8\x05x'
2022-08-29 12:30:44,325 DEBUG    Setting ErdCode.WH_HEATER_UNKNOWN4048 to b'\x01\xf4\x05x'
2022-08-29 12:30:44,325 DEBUG    Setting ErdCode.WH_HEATER_UNKNOWN4049 to b'\x12\xa8'
2022-08-29 12:30:44,325 DEBUG    Setting ErdCode.WH_HEATER_UNKNOWN404A to b'\x12\xa8'
2022-08-29 12:30:44,325 DEBUG    Setting ErdCode.WH_HEATER_UNKNOWN404B to b'\x00\x00\x00\x02'
2022-08-29 12:30:44,325 DEBUG    Got initial appliance type for GeAppliance(D828C901A920) (ErdApplianceType.WATER_HEATER)
2022-08-29 12:30:44,325 DEBUG    Appliance state change detected in GeAppliance(D828C901A920) (ErdApplianceType.WATER_HEATER). Updated keys: ErdCode.MODEL_NUMBER, ErdCode.SERIAL_NUMBER, ErdCode.TEMPERATURE_UNIT, ErdCode.APPLIANCE_TYPE, ErdCode.WIFI_MODULE_SW_VERSION, ErdCode.WIFI_MODULE_SW_VERSION_AVAILABLE, ErdCode.ACM_UPDATING, ErdCode.APPLIANCE_SW_VERSION, ErdCode.APPLIANCE_SW_VERSION_AVAILABLE, ErdCode.APPLIANCE_UPDATING, ErdCode.WH_HEATER_MODE, ErdCode.WH_HEATER_UNKNOWN4021, ErdCode.WH_HEATER_UNKNOWN4022, ErdCode.WH_HEATER_UNKNOWN4023, ErdCode.WH_HEATER_TARGET_TEMPERATURE, ErdCode.WH_HEATER_UNKNOWN4025, ErdCode.WH_HEATER_SET_TEMPERATURE, ErdCode.WH_HEATER_MODE_HOURS_REMAINING, ErdCode.WH_HEATER_UNKNOWN4040, ErdCode.WH_HEATER_UNKNOWN4041, ErdCode.WH_HEATER_UNKNOWN4046, ErdCode.WH_HEATER_UNKNOWN4047, ErdCode.WH_HEATER_UNKNOWN4048, ErdCode.WH_HEATER_UNKNOWN4049, ErdCode.WH_HEATER_UNKNOWN404A, ErdCode.WH_HEATER_UNKNOWN404B
2022-08-29 12:30:44,325 DEBUG    Appliance state change detected in GeAppliance(D828C901A920) (ErdApplianceType.WATER_HEATER)
seantibor commented 2 years ago

thanks @simbaja! Admittedly, I'm not sure what to do next now that I have those initial ErdCodes.

simbaja commented 2 years ago

Basically, we now have to get this into the actual integration. That'll require publishing the updated version of the gehomesdk library (adding a few more things, then will do that), then creating a device in the integration along with all the sensors based on the erd codes (look at the simbaja/ha_gehome repository).

I'm also looking through some of this, and I think I see a few more things that you might be able to do here (not sure how important they are):

0x4040 = Modes Available 0x4047 = Min/Max Temps 0x4049 = Vacation Mode Max Time 0x404A = Max Electric Time 0x404B = Features

simbaja commented 2 years ago

Should be published as 0.5.5, calling it a night, but let me know if you run into issues on the integration side. Only thing you'll need to do is make sure it's requesting the right version (HA recommends version pinning, so it's pulling specific versions instead of latest)

simbaja commented 2 years ago

Gave it a quick shot in release 0.6.5-dev0 in the simbaja/ha_gehome repository (and on HACS). I think we'll probably want to implement at least 0x4047 in this library to make the controls correct in HA, might want some of the others too. Let me know how it looks, hopefully it works...