simbaja / gehome

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

Burners empty for CGY366P2T1S1 #58

Closed EnochPrime closed 9 months ago

EnochPrime commented 11 months ago

Device: Café™ 36" Smart All-Gas Commercial-Style Range with 6 Burners (Natural Gas) Model: CGY366P2T1S1 Firmware: Appliance=2.0.28.62/Wifi=0.2.11.62

From the SmartHQ app it displays 6 burners, but they have never displayed a status. It appears that the device reports an empty burner state and the code assumes it will be populated.

2023-10-06 14:58:38,229 DEBUG    Setting ErdCode.COOKTOP_STATUS_EXT to CooktopStatus(status=<ErdCooktopStatus.DASH: 255>, burners={}, raw_value='0001FF0101FF0101FF0101FF0101FF0101FF0100FF0000FF0000000000000000')
2023-10-06 14:58:38,229 ERROR    Could not convert cooktop status.
Traceback (most recent call last):
  File "C:\Users\jdm12989\.virtualenvs\gehome-L9hrF__L\lib\site-packages\gehomesdk\erd\converters\oven\cooktop_status_ext_converter.py", line 27, in erd_decode
    if(any(x.on for x in burners)):
  File "C:\Users\jdm12989\.virtualenvs\gehome-L9hrF__L\lib\site-packages\gehomesdk\erd\converters\oven\cooktop_status_ext_converter.py", line 27, in <genexpr>
    if(any(x.on for x in burners)):
AttributeError: 'str' object has no attribute 'on'

Source of https://github.com/simbaja/ha_gehome/issues/201

EnochPrime commented 11 months ago

Not sure if I trust the data is the SmartHQ app doesn't report burner status, but this is what I found with limited testing after patching the code.

# ALL OFF
[0, 1, 255, 1, 1, 255, 1, 1, 255, 1, 1, 255, 1, 1, 255, 1, 1, 255, 1, 0, 255, 0, 0, 255, 0, 0, 0, 0, 0, 0, 0, 0]

# Left Front On
[1, 1, 255, 1, 1, 255, 1, 1, 255, 1, 1, 255, 1, 1, 255, 1, 1, 255, 1, 0, 255, 0, 0, 255, 0, 0, 0, 0, 0, 0, 0, 0]

# Center Front On
[1, 1, 255, 1, 1, 255, 1, 1, 255, 1, 1, 255, 1, 1, 255, 1, 1, 255, 1, 0, 255, 0, 0, 255, 0, 0, 0, 0, 0, 0, 0, 0]

It appears that the first entry is acting as a global any burner being on and the other entries don't respond.

simbaja commented 9 months ago

Apologies, just getting back into this a bit (work's been busy). The pull request I just committed I believe fixes the the burners array to offset by 1, which is what you're seeing I think. Hopefully this gets things going a bit better. Can't help with it not reporting status right though, so may not ultimately work.