simbaja / ha_gehome

GE Home Appliances (SmartHQ) for Home Assistant
MIT License
302 stars 71 forks source link

Electric Cooktop #252

Closed tandyjames closed 1 month ago

tandyjames commented 2 months ago

Thank you so much for creating this integration, 5 of my 6 appliances loaded instantly and work perfectly. One device that doesn't show up is my ErdApplianceType.ELECTRIC_COOKTOP. I looked at some of the other requests and saw to use gehome-appliance-data from https://github.com/simbaja/gehome

Here are the relevant results:

2024-05-05 00:34:44,534 DEBUG    Setting ErdCode.COOKTOP_CONFIG to ErdCooktopConfig.PRESENT
2024-05-05 00:34:44,536 DEBUG    Setting ErdCode.COOKTOP_STATUS to CooktopStatus(status=<ErdCooktopStatus.OFF: 0>, burners={'leftFront': <gehomesdk.erd.values.oven.burner.Burner object at 0x00000196AF3843B0>, 'leftRear': <gehomesdk.erd.values.oven.burner.Burner object at 0x00000196AF3844D0>, 'centerFront': <gehomesdk.erd.values.oven.burner.Burner object at 0x00000196AF384260>, 'centerRear': <gehomesdk.erd.values.oven.burner.Burner object at 0x00000196AF384BF0>, 'rightFront': <gehomesdk.erd.values.oven.burner.Burner object at 0x00000196AF384650>, 'rightRear': <gehomesdk.erd.values.oven.burner.Burner object at 0x00000196AF3849B0>}, raw_value='000300030000FF010001000100')
2024-05-05 00:34:44,536 DEBUG    Setting 0x576F to b'p\x01\x00\x00'
2024-05-05 00:34:44,536 DEBUG    Setting ErdCode.CLOSED_LOOP_COOKING_CONFIGURATION to b'\x04'
...
2024-05-05 00:34:44,539 DEBUG    received event: appliance_update_received, processing callbacks...
2024-05-05 00:34:44,539 DEBUG    Got initial appliance type for GeAppliance(010000FC9762) (ErdApplianceType.ELECTRIC_COOKTOP)
2024-05-05 00:34:44,539 DEBUG    received event: appliance_got_type, processing callbacks...
2024-05-05 00:34:44,539 DEBUG    processing callback: <function detect_appliance_type at 0x00000196AEF9D9E0>
2024-05-05 00:34:44,539 DEBUG    Appliance state change detected in GeAppliance(010000FC9762) (ErdApplianceType.ELECTRIC_COOKTOP). Updated keys: ErdCode.MODEL_NUMBER, ErdCode.SERIAL_NUMBER, ErdCode.TEMPERATURE_UNIT, ErdCode.APPLIANCE_TYPE, ErdCode.SOUND_LEVEL, ErdCode.UNIT_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.END_TONE, ErdCode.UPPER_OVEN_KITCHEN_TIMER, ErdCode.COOKTOP_CONFIG, ErdCode.COOKTOP_STATUS, 0x576F, ErdCode.CLOSED_LOOP_COOKING_CONFIGURATION, 0x5771, 0x5772, 0x5773, 0x5774, 0x5775, 0x5776, 0x5777, 0x5778, 0x5779, 0x577A, 0x577B, 0x577C, 0x577D, 0x577E, 0x5780, 0x5781, 0x5782, 0x5783, 0x578A, 0x578B, 0x578C, 0x6200, 0x6201, 0x6202, 0x6203, 0x6204
2024-05-05 00:34:44,539 DEBUG    Appliance state change detected in GeAppliance(010000FC9762) (ErdApplianceType.ELECTRIC_COOKTOP)

I think turned the 'rightFront' burner on set the temp and turned it off while the program was running:

2024-05-05 08:01:45,187 DEBUG    < TEXT '{"item":{"applianceId":"010000FC9762","erd":"0x...rId":"0dadec3cmrc9pep"}' [221 bytes]
2024-05-05 08:01:45,187 DEBUG    Setting ErdCode.COOKTOP_STATUS to CooktopStatus(status=<ErdCooktopStatus.BURNERS_ON: 1>, burners={'leftFront': <gehomesdk.erd.values.oven.burner.Burner object at 0x00000189201FB980>, 'leftRear': <gehomesdk.erd.values.oven.burner.Burner object at 0x00000189201FB830>, 'centerFront': <gehomesdk.erd.values.oven.burner.Burner object at 0x00000189201FBA70>, 'centerRear': <gehomesdk.erd.values.oven.burner.Burner object at 0x00000189201FBA40>, 'rightFront': <gehomesdk.erd.values.oven.burner.Burner object at 0x00000189201FB9E0>, 'rightRear': <gehomesdk.erd.values.oven.burner.Burner object at 0x00000189201FBB90>}, raw_value='010300030000FF010041000100')
2024-05-05 08:01:45,188 DEBUG    received event: appliance_state_change, processing callbacks...
...
2024-05-05 08:01:45,188 DEBUG    Appliance state change detected in GeAppliance(010000FC9762) (ErdApplianceType.ELECTRIC_COOKTOP). Updated keys: ErdCode.COOKTOP_STATUS
2024-05-05 08:01:47,102 DEBUG    < TEXT '{"item":{"applianceId":"FCB97E064C29","erd":"0x...rId":"0dadec3cmrc9pep"}' [197 bytes]
...
2024-05-05 08:01:49,154 DEBUG    Setting ErdCode.COOKTOP_STATUS to CooktopStatus(status=<ErdCooktopStatus.BURNERS_ON: 1>, burners={'leftFront': <gehomesdk.erd.values.oven.burner.Burner object at 0x00000189201FB8C0>, 'leftRear': <gehomesdk.erd.values.oven.burner.Burner object at 0x00000189201FB290>, 'centerFront': <gehomesdk.erd.values.oven.burner.Burner object at 0x00000189201FB3B0>, 'centerRear': <gehomesdk.erd.values.oven.burner.Burner object at 0x00000189201FB440>, 'rightFront': <gehomesdk.erd.values.oven.burner.Burner object at 0x00000189201FB320>, 'rightRear': <gehomesdk.erd.values.oven.burner.Burner object at 0x00000189201FBB00>}, raw_value='010300030000FF010041490100')
2024-05-05 08:01:49,154 DEBUG    received event: appliance_state_change, processing callbacks...
...
2024-05-05 08:01:49,155 DEBUG    Appliance state change detected in GeAppliance(010000FC9762) (ErdApplianceType.ELECTRIC_COOKTOP). Updated keys: ErdCode.COOKTOP_STATUS
...
2024-05-05 08:02:03,662 DEBUG    < TEXT '{"item":{"applianceId":"010000FC9762","erd":"0x...rId":"0dadec3cmrc9pep"}' [221 bytes]
2024-05-05 08:02:03,662 DEBUG    Setting ErdCode.COOKTOP_STATUS to CooktopStatus(status=<ErdCooktopStatus.OFF: 0>, burners={'leftFront': <gehomesdk.erd.values.oven.burner.Burner object at 0x00000189201BB800>, 'leftRear': <gehomesdk.erd.values.oven.burner.Burner object at 0x000001891F2E8B30>, 'centerFront': <gehomesdk.erd.values.oven.burner.Burner object at 0x000001891FC345C0>, 'centerRear': <gehomesdk.erd.values.oven.burner.Burner object at 0x000001891FC378F0>, 'rightFront': <gehomesdk.erd.values.oven.burner.Burner object at 0x000001891FD556D0>, 'rightRear': <gehomesdk.erd.values.oven.burner.Burner object at 0x000001891FD55B80>}, raw_value='000300030000FF010001000100')
...
2024-05-05 08:02:03,663 DEBUG    Appliance state change detected in GeAppliance(010000FC9762) (ErdApplianceType.ELECTRIC_COOKTOP). Updated keys: ErdCode.COOKTOP_STATUS

It seems like the SDK already has knowledge and code around the ELECTRIC_COOKTOP, it's just not plumbed through the HA project. Let me know if this would be relatively easy and something you are willing to do (if so, let me know what other data you might need or when I can test for you). Otherwise, if you'd like me to try at creating a pull request, do you have an example of another device I should try to "copy"?

Thanks again for all you do!!!

simbaja commented 1 month ago

Should be good in the dev branch now and will be part of the next release. Was missing a mapping (had the mapping for cooktop but not electric_cooktop - no idea why there's a difference). Feel free to manually install the dev (copy the files) or wait for the next release candidate. Let me know if it doesn't work for you! Thanks for your help!

tandyjames commented 1 month ago

Awesome... I really appreciate it. I'll let you know if I find any issue with it. Thanks again!!