simbaja / gehome

Python SDK for GE smart appliances
MIT License
45 stars 31 forks source link

GE Profile UltraFast Combo: Separate Wash/Dry Times (Total & Remaining) #61

Open phrz opened 1 year ago

phrz commented 1 year ago

On the new GE Combo washer/dryer, is it possible through the API to determine the total wash/dry times and the remaining wash/dry times? Right now, this SDK (and the associated HA integration) only display the total time remaining overall. I am hoping to develop a Home Assistant card that emulates the device's built-in display which shows this information. I do not know much about how this API works, but I am happy to provide any data I can from my machine.

Below are the redacted results of my running gehome-appliance-data, please let me know if I can provide any more information. It represents a combined wash/dry cycle, on the drying phase, with 45 minutes remaining.

Using slower stringprep, consider compiling the faster cython/libidn one.
2023-11-18 11:58:51,044 DEBUG    Using selector: KqueueSelector
2023-11-18 11:58:51,045 DEBUG    Getting OAuth2 token
2023-11-18 11:58:51,045 DEBUG    received event: state_changed, processing callbacks...
2023-11-18 11:58:51,045 DEBUG    processing callback: <bound method GeBaseClient._on_state_change of <gehomesdk.clients.websocket_client.GeWebsocketClient object at 0x102bb3ad0>>
2023-11-18 11:58:51,051 DEBUG    Client changed state: GeClientState.INITIALIZING to GeClientState.AUTHORIZING_OAUTH
2023-11-18 11:58:53,117 DEBUG    Getting WS credentials
2023-11-18 11:58:53,118 DEBUG    received event: state_changed, processing callbacks...
2023-11-18 11:58:53,118 DEBUG    processing callback: <bound method GeBaseClient._on_state_change of <gehomesdk.clients.websocket_client.GeWebsocketClient object at 0x102bb3ad0>>
2023-11-18 11:58:53,119 DEBUG    Client changed state: GeClientState.AUTHORIZING_OAUTH to GeClientState.AUTHORIZING_CLIENT
2023-11-18 11:58:53,282 INFO     Starting GE Appliances client
2023-11-18 11:58:53,282 DEBUG    received event: state_changed, processing callbacks...
2023-11-18 11:58:53,282 DEBUG    processing callback: <bound method GeBaseClient._on_state_change of <gehomesdk.clients.websocket_client.GeWebsocketClient object at 0x102bb3ad0>>
2023-11-18 11:58:53,308 DEBUG    Client changed state: GeClientState.AUTHORIZING_CLIENT to GeClientState.CONNECTING
2023-11-18 11:58:53,368 DEBUG    = connection is CONNECTING
2023-11-18 11:58:53,476 DEBUG    > GET /?access_token=******************************** HTTP/1.1
2023-11-18 11:58:53,477 DEBUG    > Host: ws-us-east-1.brillion.geappliances.com
2023-11-18 11:58:53,477 DEBUG    > Upgrade: websocket
2023-11-18 11:58:53,477 DEBUG    > Connection: Upgrade
2023-11-18 11:58:53,477 DEBUG    > Sec-WebSocket-Key: ************************
2023-11-18 11:58:53,477 DEBUG    > Sec-WebSocket-Version: 13
2023-11-18 11:58:53,477 DEBUG    > User-Agent: Python/3.12 websockets/12.0
2023-11-18 11:58:53,733 DEBUG    < HTTP/1.1 101 Switching Protocols
2023-11-18 11:58:53,733 DEBUG    < Date: Sat, 18 Nov 2023 17:58:53 GMT
2023-11-18 11:58:53,734 DEBUG    < Connection: upgrade
2023-11-18 11:58:53,734 DEBUG    < upgrade: websocket
2023-11-18 11:58:53,734 DEBUG    < sec-websocket-accept: ****************************
2023-11-18 11:58:53,734 DEBUG    = connection is OPEN
2023-11-18 11:58:53,734 DEBUG    > TEXT '{"kind": "websocket#subscribe", "action": "subs...["/appliance/*/erd/*"]}' [91 bytes]
2023-11-18 11:58:53,735 DEBUG    received event: state_changed, processing callbacks...
2023-11-18 11:58:53,736 DEBUG    processing callback: <bound method GeBaseClient._on_state_change of <gehomesdk.clients.websocket_client.GeWebsocketClient object at 0x102bb3ad0>>
2023-11-18 11:58:53,736 DEBUG    > TEXT '{"kind": "websocket#api", "action": "api", "hos...id": "List-appliances"}' [150 bytes]
2023-11-18 11:58:53,736 DEBUG    Client changed state: GeClientState.CONNECTING to GeClientState.CONNECTED
2023-11-18 11:58:53,736 DEBUG    received event: connected, processing callbacks...
2023-11-18 11:58:53,841 DEBUG    < TEXT '{"kind":"websocket#subscribe","success":true}' [45 bytes]
2023-11-18 11:58:53,958 DEBUG    < TEXT '{"kind":"websocket#api","id":"List-appliances",...1-18T05:56:14.374Z"}]}}' [457 bytes]
2023-11-18 11:58:53,960 DEBUG    ************ marked available
2023-11-18 11:58:53,960 DEBUG    Adding appliance ************
2023-11-18 11:58:53,960 DEBUG    received event: add_appliance, processing callbacks...
2023-11-18 11:58:53,960 DEBUG    processing callback: <function do_periodic_update at 0x102d52020>
2023-11-18 11:58:53,960 DEBUG    Requesting update for client ************
2023-11-18 11:58:53,960 DEBUG    > TEXT '{"kind": "websocket#api", "action": "api", "hos... "************-allErd"}' [171 bytes]
2023-11-18 11:58:53,961 DEBUG    Registering update callback for GeAppliance(************) (Unknown Type)
2023-11-18 11:58:53,961 DEBUG    Requesting features for client ************
2023-11-18 11:58:53,961 DEBUG    > TEXT '{"kind": "websocket#api", "action": "api", "hos...d": "Request-features"}' [172 bytes]
2023-11-18 11:58:53,962 DEBUG    received event: got_appliance_list, processing callbacks...
2023-11-18 11:58:54,062 DEBUG    < TEXT '{"kind":"websocket#connect","success":true}' [43 bytes]
2023-11-18 11:58:54,155 DEBUG    < TEXT '{"kind":"websocket#api","id":"Request-features"...WRINKLE_CARE_OPTION"]}}' [793 bytes]
2023-11-18 11:58:54,156 DEBUG    Received features ['COMBINATION_WASHER_DRYER_V2_ADAPTIVE_SMART_DISPENSE_AND_ADJUSTABILITY_DETERGENT_TANK', 'COMBINATION_WASHER_DRYER_V2_ADAPTIVE_SMART_DISPENSE_AND_ADJUSTABILITY_SOFTENER_TANK', 'COMBINATION_WASHER_DRYER_V2_CONTROL_LOCK_OPTION', 'COMBINATION_WASHER_DRYER_V2_DELAY_START', 'COMBINATION_WASHER_DRYER_V2_DOWNLOADED_CYCLE', 'COMBINATION_WASHER_DRYER_V2_FOUNDATION', 'COMBINATION_WASHER_DRYER_V2_PUSH_NOTIFICATIONS', 'COMBINATION_WASHER_DRYER_V2_REMOTE_START', 'COMBINATION_WASHER_DRYER_V2_WRINKLE_CARE_OPTION'] for ************
2023-11-18 11:58:54,156 DEBUG    received event: got_appliance_features, processing callbacks...
2023-11-18 11:58:54,189 DEBUG    < TEXT '{"kind":"websocket#api","id":"************-allE...time":"2023-11-18T05:58' [4096 bytes, continued]
2023-11-18 11:58:54,189 DEBUG    < CONT ':16.963Z"},{"erd":"0x2144","value":"010200","ti...1-18T05:58:16.963Z"}]}}' [text, 471 bytes]
2023-11-18 11:58:54,190 DEBUG    Setting ErdCode.MODEL_NUMBER to ************
2023-11-18 11:58:54,190 DEBUG    Setting ErdCode.SERIAL_NUMBER to *********
2023-11-18 11:58:54,190 DEBUG    Setting ErdCode.APPLIANCE_TYPE to ErdApplianceType.COMBINATION_WASHER_DRYER
2023-11-18 11:58:54,190 DEBUG    Setting ErdCode.BRAND to ErdBrand.UNKNOWN
2023-11-18 11:58:54,190 DEBUG    Setting ErdCode.WIFI_MODULE_SW_VERSION to 0.3.15.100
2023-11-18 11:58:54,191 DEBUG    Setting ErdCode.WIFI_MODULE_SW_VERSION_AVAILABLE to 0.0.0.0
2023-11-18 11:58:54,191 DEBUG    Setting ErdCode.ACM_UPDATING to False
2023-11-18 11:58:54,191 DEBUG    Setting ErdCode.APPLIANCE_SW_VERSION to 0.0.0.0
2023-11-18 11:58:54,191 DEBUG    Setting ErdCode.APPLIANCE_SW_VERSION_AVAILABLE to 45.0.4.64
2023-11-18 11:58:54,191 DEBUG    Setting ErdCode.APPLIANCE_UPDATING to True
2023-11-18 11:58:54,191 DEBUG    Setting ErdCode.LAUNDRY_MACHINE_STATE to Run
2023-11-18 11:58:54,191 DEBUG    Setting ErdCode.LAUNDRY_SUB_CYCLE to ErdLaundrySubCycle.DRYING
2023-11-18 11:58:54,191 DEBUG    Setting ErdCode.LAUNDRY_TIME_REMAINING to 0:45:00
2023-11-18 11:58:54,191 DEBUG    Setting ErdCode.LAUNDRY_CYCLE to ErdLaundryCycle.TOWEL
2023-11-18 11:58:54,191 DEBUG    Setting ErdCode.LAUNDRY_DELAY_TIME_REMAINING to 0:00:00
2023-11-18 11:58:54,191 DEBUG    Got timespan value of 65535. Treating as None.
2023-11-18 11:58:54,191 DEBUG    Setting ErdCode.LAUNDRY_REMOTE_STATUS to False
2023-11-18 11:58:54,191 DEBUG    Setting ErdCode.LAUNDRY_WASHER_SMART_DISPENSE_TANK_STATUS to ErdSmartDispenseTankStatus.FULL
2023-11-18 11:58:54,192 DEBUG    Setting ErdCode.LAUNDRY_WASHER_SMART_DISPENSE to ErdSmartDispense(loads_left=255, raw_value='FF00')
2023-11-18 11:58:54,192 DEBUG    Setting ErdCode.LAUNDRY_WASHER_UNKNOWN203E to b'\x01\xf4'
2023-11-18 11:58:54,192 DEBUG    Setting ErdCode.LAUNDRY_REMOTE_POWER_CONTROL to ErdOnOff.NA
2023-11-18 11:58:54,192 DEBUG    Setting ErdCode.LAUNDRY_DRYER_UNKNOWN2051 to b'\xff'
2023-11-18 11:58:54,192 DEBUG    Setting ErdCode.LAUNDRY_DRYER_TUMBLENEW_STATUS to ErdTumbleStatus.ENABLE
2023-11-18 11:58:54,192 DEBUG    Setting ErdCode.LAUNDRY_WASHER_PREWASH to False
2023-11-18 11:58:54,192 DEBUG    Setting ErdCode.LAUNDRY_WASHER_UNKNOWN2070 to b'\x00\x00'
2023-11-18 11:58:54,192 DEBUG    Setting 0x2071 to b'\x00'
2023-11-18 11:58:54,192 DEBUG    Setting ErdCode.LAUNDRY_WASHER_UNKNOWN2072 to b'$'
2023-11-18 11:58:54,192 DEBUG    Setting 0x2083 to b'\x01'
2023-11-18 11:58:54,192 DEBUG    Setting 0x2085 to b'\x00\x06'
2023-11-18 11:58:54,193 DEBUG    Setting 0x2089 to b'\x00'
2023-11-18 11:58:54,193 DEBUG    Setting 0x20AD to b'\x00'
2023-11-18 11:58:54,193 DEBUG    Setting 0x20B3 to b'\x00'
2023-11-18 11:58:54,193 DEBUG    Setting 0x20BB to b'\x05'
2023-11-18 11:58:54,193 DEBUG    Setting 0x20BE to b'\x03'
2023-11-18 11:58:54,193 DEBUG    Setting 0x20C0 to b'\x01'
2023-11-18 11:58:54,193 DEBUG    Setting 0x20C2 to b'\x00\x00\x03'
2023-11-18 11:58:54,193 DEBUG    Setting 0x20D2 to b'\x00\x08\x02\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'
2023-11-18 11:58:54,193 DEBUG    Setting 0x20D3 to b'\x0b'
2023-11-18 11:58:54,193 DEBUG    Setting 0x20D7 to b'\x04'
2023-11-18 11:58:54,193 DEBUG    Setting 0x2122 to b'\x00\x00'
2023-11-18 11:58:54,193 DEBUG    Setting 0x2123 to b'\n\x8c'
2023-11-18 11:58:54,193 DEBUG    Setting 0x2127 to b'\x01'
2023-11-18 11:58:54,193 DEBUG    Setting 0x2128 to b'\x01'
2023-11-18 11:58:54,193 DEBUG    Setting 0x212B to b'\x00'
2023-11-18 11:58:54,193 DEBUG    Setting 0x212E to b'\x00'
2023-11-18 11:58:54,194 DEBUG    Setting 0x2131 to b'\x00'
2023-11-18 11:58:54,194 DEBUG    Setting 0x2134 to b'\x00'
2023-11-18 11:58:54,194 DEBUG    Setting 0x2139 to b'\x04'
2023-11-18 11:58:54,194 DEBUG    Setting 0x213A to b'\x00'
2023-11-18 11:58:54,194 DEBUG    Setting 0x213C to b'\x01@'
2023-11-18 11:58:54,194 DEBUG    Setting 0x213D to b'\x01'
2023-11-18 11:58:54,194 DEBUG    Setting 0x213E to b'\x00'
2023-11-18 11:58:54,194 DEBUG    Setting 0x213F to b'\x02'
2023-11-18 11:58:54,194 DEBUG    Setting 0x2140 to b'\x00'
2023-11-18 11:58:54,194 DEBUG    Setting 0x2141 to b'\x00\x00\x00\x00'
2023-11-18 11:58:54,194 DEBUG    Setting 0x2142 to b'\x01'
2023-11-18 11:58:54,194 DEBUG    Setting 0x2144 to b'\x01\x02\x00'
2023-11-18 11:58:54,194 DEBUG    Setting 0x2145 to b'\x00\x00'
2023-11-18 11:58:54,195 DEBUG    Setting 0x2146 to b'\x00\x00'
2023-11-18 11:58:54,195 DEBUG    Setting 0x2147 to b'\x00\x00'
2023-11-18 11:58:54,195 DEBUG    Setting 0x2148 to b'\x00'
2023-11-18 11:58:54,195 DEBUG    Setting 0x214A to b'\x00'
2023-11-18 11:58:54,195 DEBUG    Setting 0x2155 to b'\x00'
2023-11-18 11:58:54,195 DEBUG    received event: appliance_state_change, processing callbacks...
2023-11-18 11:58:54,195 DEBUG    processing callback: <bound method GeBaseClient._maybe_trigger_appliance_init_event of <gehomesdk.clients.websocket_client.GeWebsocketClient object at 0x102bb3ad0>>
2023-11-18 11:58:54,195 DEBUG    processing callback: <function log_state_change at 0x102d51ee0>
2023-11-18 11:58:54,195 DEBUG    received event: appliance_update_received, processing callbacks...
2023-11-18 11:58:54,195 DEBUG    Got initial appliance type for GeAppliance(************) (ErdApplianceType.COMBINATION_WASHER_DRYER)
2023-11-18 11:58:54,195 DEBUG    received event: appliance_got_type, processing callbacks...
2023-11-18 11:58:54,195 DEBUG    processing callback: <function detect_appliance_type at 0x102d51f80>
2023-11-18 11:58:54,195 DEBUG    Appliance state change detected in GeAppliance(************) (ErdApplianceType.COMBINATION_WASHER_DRYER). Updated keys: ErdCode.MODEL_NUMBER, ErdCode.SERIAL_NUMBER, ErdCode.APPLIANCE_TYPE, ErdCode.BRAND, 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.LAUNDRY_MACHINE_STATE, ErdCode.LAUNDRY_SUB_CYCLE, ErdCode.LAUNDRY_TIME_REMAINING, ErdCode.LAUNDRY_CYCLE, ErdCode.LAUNDRY_DELAY_TIME_REMAINING, ErdCode.LAUNDRY_REMOTE_STATUS, ErdCode.LAUNDRY_WASHER_SMART_DISPENSE_TANK_STATUS, ErdCode.LAUNDRY_WASHER_SMART_DISPENSE, ErdCode.LAUNDRY_WASHER_UNKNOWN203E, ErdCode.LAUNDRY_REMOTE_POWER_CONTROL, ErdCode.LAUNDRY_DRYER_UNKNOWN2051, ErdCode.LAUNDRY_DRYER_TUMBLENEW_STATUS, ErdCode.LAUNDRY_WASHER_PREWASH, ErdCode.LAUNDRY_WASHER_UNKNOWN2070, 0x2071, ErdCode.LAUNDRY_WASHER_UNKNOWN2072, 0x2083, 0x2085, 0x2089, 0x20AD, 0x20B3, 0x20BB, 0x20BE, 0x20C0, 0x20C2, 0x20D2, 0x20D3, 0x20D7, 0x2122, 0x2123, 0x2127, 0x2128, 0x212B, 0x212E, 0x2131, 0x2134, 0x2139, 0x213A, 0x213C, 0x213D, 0x213E, 0x213F, 0x2140, 0x2141, 0x2142, 0x2144, 0x2145, 0x2146, 0x2147, 0x2148, 0x214A, 0x2155
2023-11-18 11:58:54,195 DEBUG    Appliance state change detected in GeAppliance(************) (ErdApplianceType.COMBINATION_WASHER_DRYER)
2023-11-18 11:58:54,244 DEBUG    < TEXT '{"resource":"/appliance/*/erd/*","kind":"websoc...:true,"change":"ADDED"}' [97 bytes]
2023-11-18 11:59:13,736 DEBUG    % sending keepalive ping
2023-11-18 11:59:13,736 DEBUG    > PING 4f 0d 05 ed [binary, 4 bytes]
2023-11-18 11:59:13,779 DEBUG    < PONG 4f 0d 05 ed [binary, 4 bytes]
2023-11-18 11:59:13,780 DEBUG    % received keepalive pong
2023-11-18 11:59:21,685 DEBUG    < TEXT '{"item":{"applianceId":"************","erd":"0x...rId":"1kf5rk7zy19xbup"}' [199 bytes]
2023-11-18 11:59:21,685 DEBUG    < TEXT '{"item":{"applianceId":"************","erd":"0x...rId":"1kf5rk7zy19xbup"}' [199 bytes]
2023-11-18 11:59:21,686 DEBUG    Setting ErdCode.LAUNDRY_TIME_REMAINING to 0:44:00
2023-11-18 11:59:21,686 DEBUG    received event: appliance_state_change, processing callbacks...
2023-11-18 11:59:21,686 DEBUG    processing callback: <bound method GeBaseClient._maybe_trigger_appliance_init_event of <gehomesdk.clients.websocket_client.GeWebsocketClient object at 0x102bb3ad0>>
2023-11-18 11:59:21,686 DEBUG    processing callback: <function log_state_change at 0x102d51ee0>
2023-11-18 11:59:21,686 DEBUG    received event: appliance_update_received, processing callbacks...
2023-11-18 11:59:21,686 DEBUG    Appliance state change detected in GeAppliance(************) (ErdApplianceType.COMBINATION_WASHER_DRYER). Updated keys: ErdCode.LAUNDRY_TIME_REMAINING
2023-11-18 11:59:21,687 DEBUG    Setting 0x2123 to b'\nP'
2023-11-18 11:59:21,687 DEBUG    received event: appliance_state_change, processing callbacks...
2023-11-18 11:59:21,687 DEBUG    processing callback: <bound method GeBaseClient._maybe_trigger_appliance_init_event of <gehomesdk.clients.websocket_client.GeWebsocketClient object at 0x102bb3ad0>>
2023-11-18 11:59:21,687 DEBUG    processing callback: <function log_state_change at 0x102d51ee0>
2023-11-18 11:59:21,687 DEBUG    received event: appliance_update_received, processing callbacks...
2023-11-18 11:59:21,687 DEBUG    Appliance state change detected in GeAppliance(************) (ErdApplianceType.COMBINATION_WASHER_DRYER). Updated keys: 0x2123
2023-11-18 11:59:23,737 DEBUG    Sending keepalive ping
2023-11-18 11:59:23,737 DEBUG    > TEXT '{"kind": "websocket#ping", "id": "keepalive-ping", "action": "ping"}' [68 bytes]
2023-11-18 11:59:23,843 DEBUG    < TEXT '{"kind":"websocket#pong","id":"keepalive-ping"}' [47 bytes]
2023-11-18 11:59:33,781 DEBUG    % sending keepalive ping
2023-11-18 11:59:33,782 DEBUG    > PING 68 e3 19 5e [binary, 4 bytes]
2023-11-18 11:59:33,821 DEBUG    < PONG 68 e3 19 5e [binary, 4 bytes]
2023-11-18 11:59:33,821 DEBUG    % received keepalive pong
2023-11-18 11:59:53,739 DEBUG    Sending keepalive ping
2023-11-18 11:59:53,741 DEBUG    > TEXT '{"kind": "websocket#ping", "id": "keepalive-ping", "action": "ping"}' [68 bytes]
2023-11-18 11:59:53,811 DEBUG    < TEXT '{"kind":"websocket#pong","id":"keepalive-ping"}' [47 bytes]
2023-11-18 11:59:53,823 DEBUG    % sending keepalive ping
2023-11-18 11:59:53,823 DEBUG    > PING 0d a6 b6 6d [binary, 4 bytes]
2023-11-18 11:59:53,862 DEBUG    < PONG 0d a6 b6 6d [binary, 4 bytes]
2023-11-18 11:59:53,862 DEBUG    % received keepalive pong
2023-11-18 11:59:53,962 DEBUG    Requesting update for GeAppliance(************) (ErdApplianceType.COMBINATION_WASHER_DRYER)
2023-11-18 11:59:53,963 DEBUG    Requesting update for client ************
2023-11-18 11:59:53,963 DEBUG    > TEXT '{"kind": "websocket#api", "action": "api", "hos... "************-allErd"}' [171 bytes]
2023-11-18 11:59:54,170 DEBUG    < TEXT '{"kind":"websocket#api","id":"************-allE...time":"2023-11-18T05:58' [4096 bytes, continued]
2023-11-18 11:59:54,170 DEBUG    < CONT ':16.963Z"},{"erd":"0x2144","value":"010200","ti...1-18T05:58:16.963Z"}]}}' [text, 471 bytes]
2023-11-18 11:59:54,172 DEBUG    Got timespan value of 65535. Treating as None.
2023-11-18 11:59:54,173 DEBUG    received event: appliance_update_received, processing callbacks...
simbaja commented 11 months ago

It's possible that the 0x20 and 0x21 codes would be useful for what you're looking for. What does the official app show? If it's possible in there, it should be possible via this integration as well, but we have to decode it ourselves. If you're looking for the timer, you'd probably want to decode some of the unknown bytes and see if they match the time shown (probably in minutes).