Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue getting device encryption key! #220

Open
Tiger770 opened this issue Nov 14, 2024 · 9 comments
Open

Issue getting device encryption key! #220

Tiger770 opened this issue Nov 14, 2024 · 9 comments

Comments

@Tiger770
Copy link

Describe the bug
When attempting to connect to my unit, I am getting an error message in the debug logs that it was unable to get device encryption key. As a result, none of the features for the AC refresh to show status or allow me to change modes / temps / etc.

This was previously working and stopped with a recent update.

Configuration

  • platform: gree
    name: First AC
    host: 192.168.1.168
    port: 7000
    mac: "F4:91:1E:F8:49:35"
    target_temp_step: 1
    encryption_version: 2
    uid: 1000116
    temp_sensor: sensor.shop_temperature
    lights: input_boolean.first_ac_lights
    xfan: input_boolean.first_ac_xfan
    health: input_boolean.first_ac_health
    sleep: input_boolean.first_ac_sleep
    powersave: input_boolean.first_ac_powersave
    eightdegheat: input_boolean.first_ac_eightdegheat
    air: input_boolean.first_ac_air
    max_online_attempts: 1
    disable_available_check: true

Platform:

  • OS: Windows
  • Browser: chrome & Edge
  • Version: Latest

Logs
2024-11-14 10:27:55.763 INFO (MainThread) [custom_components.gree.climate] should_poll()
2024-11-14 10:27:55.764 INFO (SyncWorker_4) [custom_components.gree.climate] update()
2024-11-14 10:27:55.764 INFO (SyncWorker_4) [custom_components.gree.climate] Retrieving HVAC encryption key
2024-11-14 10:27:55.765 INFO (SyncWorker_4) [custom_components.gree.climate] Fetching(192.168.1.168, 7000, 10, {"cid": "app","i": 1,"pack": "Jtod3XIt89K1stGOa2REUoInsM4W2wr1NUZ4HfiGx6vTLC8J2Uxne8WksqHCUsiK2rKjB4SjLqJU+JiIKaCQlK3d2AW+f1R7bQ==","t":"pack","tcid":"f4-91-1e-f8-49-35","uid": 0, "tag" : "la9S5mDBzjhaPo2m4Obvxw=="})
2024-11-14 10:27:55.765 INFO (SyncWorker_4) [custom_components.gree.climate] 3
2024-11-14 10:28:03.772 INFO (MainThread) [custom_components.gree.climate] hvac_modes(): [<HVACMode.AUTO: 'auto'>, <HVACMode.COOL: 'cool'>, <HVACMode.DRY: 'dry'>, <HVACMode.FAN_ONLY: 'fan_only'>, <HVACMode.HEAT: 'heat'>, <HVACMode.OFF: 'off'>]
2024-11-14 10:28:03.773 INFO (SyncWorker_11) [custom_components.gree.climate] set_hvac_mode(): heat
2024-11-14 10:28:03.773 INFO (SyncWorker_11) [custom_components.gree.climate] hvac_modes(): [<HVACMode.AUTO: 'auto'>, <HVACMode.COOL: 'cool'>, <HVACMode.DRY: 'dry'>, <HVACMode.FAN_ONLY: 'fan_only'>, <HVACMode.HEAT: 'heat'>, <HVACMode.OFF: 'off'>]
2024-11-14 10:28:03.773 INFO (SyncWorker_11) [custom_components.gree.climate] Starting SyncState
2024-11-14 10:28:03.774 INFO (SyncWorker_11) [custom_components.gree.climate] Could not connect with device.
2024-11-14 10:28:03.774 INFO (MainThread) [custom_components.gree.climate] supported_features(): 425
2024-11-14 10:28:03.774 INFO (MainThread) [custom_components.gree.climate] temperature_unit(): °C
2024-11-14 10:28:03.774 INFO (MainThread) [custom_components.gree.climate] hvac_modes(): [<HVACMode.AUTO: 'auto'>, <HVACMode.COOL: 'cool'>, <HVACMode.DRY: 'dry'>, <HVACMode.FAN_ONLY: 'fan_only'>, <HVACMode.HEAT: 'heat'>, <HVACMode.OFF: 'off'>]
2024-11-14 10:28:03.774 INFO (MainThread) [custom_components.gree.climate] min_temp(): 16
2024-11-14 10:28:03.774 INFO (MainThread) [custom_components.gree.climate] max_temp(): 30
2024-11-14 10:28:03.774 INFO (MainThread) [custom_components.gree.climate] target_temperature_step(): 1.0
2024-11-14 10:28:03.774 INFO (MainThread) [custom_components.gree.climate] fan_list(): ['Auto', 'Low', 'Medium-Low', 'Medium', 'Medium-High', 'High', 'Turbo', 'Quiet']
2024-11-14 10:28:03.774 INFO (MainThread) [custom_components.gree.climate] swing_modes(): ['Default', 'Swing in full range', 'Fixed in the upmost position', 'Fixed in the middle-up position', 'Fixed in the middle position', 'Fixed in the middle-low position', 'Fixed in the lowest position', 'Swing in the downmost region', 'Swing in the middle-low region', 'Swing in the middle region', 'Swing in the middle-up region', 'Swing in the upmost region']
2024-11-14 10:28:03.774 INFO (MainThread) [custom_components.gree.climate] hvac_mode(): off
2024-11-14 10:28:03.774 INFO (MainThread) [custom_components.gree.climate] supported_features(): 425
2024-11-14 10:28:03.774 INFO (MainThread) [custom_components.gree.climate] temperature_unit(): °C
2024-11-14 10:28:03.774 INFO (MainThread) [custom_components.gree.climate] current_temperature(): None
2024-11-14 10:28:03.775 INFO (MainThread) [custom_components.gree.climate] target_temperature(): None
2024-11-14 10:28:03.775 INFO (MainThread) [custom_components.gree.climate] fan_mode(): None
2024-11-14 10:28:03.775 INFO (MainThread) [custom_components.gree.climate] swing_mode(): None
2024-11-14 10:28:03.775 INFO (MainThread) [custom_components.gree.climate] name(): First AC
2024-11-14 10:28:03.775 INFO (MainThread) [custom_components.gree.climate] supported_features(): 425
2024-11-14 10:28:03.775 INFO (MainThread) [custom_components.gree.climate] should_poll()
2024-11-14 10:28:03.775 INFO (MainThread) [custom_components.gree.climate] supported_features(): 425
2024-11-14 10:28:03.776 INFO (MainThread) [custom_components.gree.climate] temperature_unit(): °C
2024-11-14 10:28:03.776 INFO (MainThread) [custom_components.gree.climate] hvac_modes(): [<HVACMode.AUTO: 'auto'>, <HVACMode.COOL: 'cool'>, <HVACMode.DRY: 'dry'>, <HVACMode.FAN_ONLY: 'fan_only'>, <HVACMode.HEAT: 'heat'>, <HVACMode.OFF: 'off'>]
2024-11-14 10:28:03.776 INFO (MainThread) [custom_components.gree.climate] min_temp(): 16
2024-11-14 10:28:03.776 INFO (MainThread) [custom_components.gree.climate] max_temp(): 30
2024-11-14 10:28:03.776 INFO (MainThread) [custom_components.gree.climate] target_temperature_step(): 1.0
2024-11-14 10:28:03.776 INFO (MainThread) [custom_components.gree.climate] fan_list(): ['Auto', 'Low', 'Medium-Low', 'Medium', 'Medium-High', 'High', 'Turbo', 'Quiet']
2024-11-14 10:28:03.776 INFO (MainThread) [custom_components.gree.climate] swing_modes(): ['Default', 'Swing in full range', 'Fixed in the upmost position', 'Fixed in the middle-up position', 'Fixed in the middle position', 'Fixed in the middle-low position', 'Fixed in the lowest position', 'Swing in the downmost region', 'Swing in the middle-low region', 'Swing in the middle region', 'Swing in the middle-up region', 'Swing in the upmost region']
2024-11-14 10:28:03.776 INFO (MainThread) [custom_components.gree.climate] hvac_mode(): off
2024-11-14 10:28:03.776 INFO (MainThread) [custom_components.gree.climate] supported_features(): 425
2024-11-14 10:28:03.776 INFO (MainThread) [custom_components.gree.climate] temperature_unit(): °C
2024-11-14 10:28:03.776 INFO (MainThread) [custom_components.gree.climate] current_temperature(): None
2024-11-14 10:28:03.776 INFO (MainThread) [custom_components.gree.climate] target_temperature(): None
2024-11-14 10:28:03.776 INFO (MainThread) [custom_components.gree.climate] fan_mode(): None
2024-11-14 10:28:03.776 INFO (MainThread) [custom_components.gree.climate] swing_mode(): None
2024-11-14 10:28:03.776 INFO (MainThread) [custom_components.gree.climate] name(): First AC
2024-11-14 10:28:03.776 INFO (MainThread) [custom_components.gree.climate] supported_features(): 425
2024-11-14 10:28:05.775 INFO (SyncWorker_4) [custom_components.gree.climate] Error getting device encryption key!
2024-11-14 10:28:05.776 INFO (MainThread) [custom_components.gree.climate] supported_features(): 425
2024-11-14 10:28:05.776 INFO (MainThread) [custom_components.gree.climate] temperature_unit(): °C
2024-11-14 10:28:05.776 INFO (MainThread) [custom_components.gree.climate] hvac_modes(): [<HVACMode.AUTO: 'auto'>, <HVACMode.COOL: 'cool'>, <HVACMode.DRY: 'dry'>, <HVACMode.FAN_ONLY: 'fan_only'>, <HVACMode.HEAT: 'heat'>, <HVACMode.OFF: 'off'>]
2024-11-14 10:28:05.776 INFO (MainThread) [custom_components.gree.climate] min_temp(): 16
2024-11-14 10:28:05.776 INFO (MainThread) [custom_components.gree.climate] max_temp(): 30
2024-11-14 10:28:05.776 INFO (MainThread) [custom_components.gree.climate] target_temperature_step(): 1.0
2024-11-14 10:28:05.776 INFO (MainThread) [custom_components.gree.climate] fan_list(): ['Auto', 'Low', 'Medium-Low', 'Medium', 'Medium-High', 'High', 'Turbo', 'Quiet']
2024-11-14 10:28:05.776 INFO (MainThread) [custom_components.gree.climate] swing_modes(): ['Default', 'Swing in full range', 'Fixed in the upmost position', 'Fixed in the middle-up position', 'Fixed in the middle position', 'Fixed in the middle-low position', 'Fixed in the lowest position', 'Swing in the downmost region', 'Swing in the middle-low region', 'Swing in the middle region', 'Swing in the middle-up region', 'Swing in the upmost region']
2024-11-14 10:28:05.776 INFO (MainThread) [custom_components.gree.climate] hvac_mode(): off
2024-11-14 10:28:05.776 INFO (MainThread) [custom_components.gree.climate] supported_features(): 425
2024-11-14 10:28:05.776 INFO (MainThread) [custom_components.gree.climate] temperature_unit(): °C
2024-11-14 10:28:05.776 INFO (MainThread) [custom_components.gree.climate] current_temperature(): None
2024-11-14 10:28:05.776 INFO (MainThread) [custom_components.gree.climate] target_temperature(): None
2024-11-14 10:28:05.776 INFO (MainThread) [custom_components.gree.climate] fan_mode(): None
2024-11-14 10:28:05.776 INFO (MainThread) [custom_components.gree.climate] swing_mode(): None
2024-11-14 10:28:05.776 INFO (MainThread) [custom_components.gree.climate] name(): First AC
2024-11-14 10:28:05.776 INFO (MainThread) [custom_components.gree.climate] supported_features(): 425

CONTINUED:

2024-11-14 10:28:55.764 INFO (MainThread) [custom_components.gree.climate] should_poll()
2024-11-14 10:28:55.765 INFO (SyncWorker_12) [custom_components.gree.climate] update()
2024-11-14 10:28:55.765 INFO (SyncWorker_12) [custom_components.gree.climate] Retrieving HVAC encryption key
2024-11-14 10:28:55.765 INFO (SyncWorker_12) [custom_components.gree.climate] Fetching(192.168.1.168, 7000, 10, {"cid": "app","i": 1,"pack": "Jtod3XIt89K1stGOa2REUoInsM4W2wr1NUZ4HfiGx6vTLC8J2Uxne8WksqHCUsiK2rKjB4SjLqJU+JiIKaCQlK3d2AW+f1R7bQ==","t":"pack","tcid":"f4-91-1e-f8-49-35","uid": 0, "tag" : "la9S5mDBzjhaPo2m4Obvxw=="})
2024-11-14 10:28:55.766 INFO (SyncWorker_12) [custom_components.gree.climate] 3
2024-11-14 10:29:05.775 INFO (SyncWorker_12) [custom_components.gree.climate] Error getting device encryption key!
2024-11-14 10:29:05.776 INFO (MainThread) [custom_components.gree.climate] supported_features(): 425
2024-11-14 10:29:05.776 INFO (MainThread) [custom_components.gree.climate] temperature_unit(): °C
2024-11-14 10:29:05.776 INFO (MainThread) [custom_components.gree.climate] hvac_modes(): [<HVACMode.AUTO: 'auto'>, <HVACMode.COOL: 'cool'>, <HVACMode.DRY: 'dry'>, <HVACMode.FAN_ONLY: 'fan_only'>, <HVACMode.HEAT: 'heat'>, <HVACMode.OFF: 'off'>]
2024-11-14 10:29:05.776 INFO (MainThread) [custom_components.gree.climate] min_temp(): 16
2024-11-14 10:29:05.776 INFO (MainThread) [custom_components.gree.climate] max_temp(): 30
2024-11-14 10:29:05.776 INFO (MainThread) [custom_components.gree.climate] target_temperature_step(): 1.0
2024-11-14 10:29:05.776 INFO (MainThread) [custom_components.gree.climate] fan_list(): ['Auto', 'Low', 'Medium-Low', 'Medium', 'Medium-High', 'High', 'Turbo', 'Quiet']
2024-11-14 10:29:05.776 INFO (MainThread) [custom_components.gree.climate] swing_modes(): ['Default', 'Swing in full range', 'Fixed in the upmost position', 'Fixed in the middle-up position', 'Fixed in the middle position', 'Fixed in the middle-low position', 'Fixed in the lowest position', 'Swing in the downmost region', 'Swing in the middle-low region', 'Swing in the middle region', 'Swing in the middle-up region', 'Swing in the upmost region']
2024-11-14 10:29:05.776 INFO (MainThread) [custom_components.gree.climate] hvac_mode(): off
2024-11-14 10:29:05.776 INFO (MainThread) [custom_components.gree.climate] supported_features(): 425
2024-11-14 10:29:05.776 INFO (MainThread) [custom_components.gree.climate] temperature_unit(): °C
2024-11-14 10:29:05.776 INFO (MainThread) [custom_components.gree.climate] current_temperature(): None
2024-11-14 10:29:05.776 INFO (MainThread) [custom_components.gree.climate] target_temperature(): None
2024-11-14 10:29:05.776 INFO (MainThread) [custom_components.gree.climate] fan_mode(): None
2024-11-14 10:29:05.776 INFO (MainThread) [custom_components.gree.climate] swing_mode(): None
2024-11-14 10:29:05.776 INFO (MainThread) [custom_components.gree.climate] name(): First AC
2024-11-14 10:29:05.776 INFO (MainThread) [custom_components.gree.climate] supported_features(): 425

@gekkehenkie11
Copy link

gekkehenkie11 commented Nov 17, 2024

Had the same issue, didn't have the key. Thought it was a long shot and added:

encryption_version:2

To the climate.yaml and BOOOM works now! I see you already have that in your climate.yaml, so won't solve your issue but still, I'll leave this comment here, might help someone else who has encryption key issues

@bugac
Copy link

bugac commented Nov 18, 2024

most likely this problems
same as to me
#216 (comment)

@Tiger770
Copy link
Author

most likely this problems

same as to me

#216 (comment)

I read your issue and it does seem similar, however I previously had this device connected and working. It just stopped functioning after a few days, and now won't connect at all.

@IamGimli
Copy link

Had the same issue, didn't have the key. Thought it was a long shot and added:

encryption_version:2

To the climate.yaml and BOOOM works now! I see you already have that in your climate.yaml, so won't solve your issue but still, I'll leave this comment here, might help someone else who has encryption key issues

I just wanted to thank you for this because my Gree integration stopped working after updating the firmware of my Gree unit. I thought the encryption key had been reset and was having the hardest time trying to figure out what the new key was but it turns out the old key still worked, I just needed to add "encryption_version: 2" to my climate.yaml for that unit.

@Toasterme
Copy link

Had the same issue, didn't have the key. Thought it was a long shot and added:

encryption_version:2

To the climate.yaml and BOOOM works now! I see you already have that in your climate.yaml, so won't solve your issue but still, I'll leave this comment here, might help someone else who has encryption key issues

thank you ! this should be added in the doc! i just installed mine and it works without anything else! thank you!

@service-paradis
Copy link

Same problem here with any encryption_version

2024-12-10 09:22:28.660 INFO (MainThread) [custom_components.gree.climate] should_poll()
2024-12-10 09:22:28.668 INFO (SyncWorker_8) [custom_components.gree.climate] update()
2024-12-10 09:22:28.668 INFO (SyncWorker_8) [custom_components.gree.climate] Retrieving HVAC encryption key
2024-12-10 09:22:28.764 INFO (SyncWorker_8) [custom_components.gree.climate] Fetching(192.168.5.17, 7000, 10, {"cid": "app","i": 1,"pack": "Jtod3XIt89K1ssWGayxDDs527tMAzgfkbQU3H+DJwPzIJzwK21g/fY6l9aCGHseEwf35XMKtIPQDq97Iev6J","t":"pack","tcid":"f4911e69a7f0","uid": 0, "tag" : "SIyglJDmoowyRQvQ/lD8Xg=="})
2024-12-10 09:22:28.766 INFO (SyncWorker_8) [custom_components.gree.climate] 3
2024-12-10 09:22:38.784 INFO (SyncWorker_8) [custom_components.gree.climate] Error getting device encryption key!
2024-12-10 09:22:38.810 INFO (MainThread) [custom_components.gree.climate] supported_features(): 425
2024-12-10 09:22:38.811 INFO (MainThread) [custom_components.gree.climate] temperature_unit(): °C
2024-12-10 09:22:38.811 INFO (MainThread) [custom_components.gree.climate] hvac_modes(): [<HVACMode.AUTO: 'auto'>, <HVACMode.COOL: 'cool'>, <HVACMode.DRY: 'dry'>, <HVACMode.FAN_ONLY: 'fan_only'>, <HVACMode.HEAT: 'heat'>, <HVACMode.OFF: 'off'>]
2024-12-10 09:22:38.812 INFO (MainThread) [custom_components.gree.climate] min_temp(): 16
2024-12-10 09:22:38.823 INFO (MainThread) [custom_components.gree.climate] max_temp(): 30
2024-12-10 09:22:38.824 INFO (MainThread) [custom_components.gree.climate] target_temperature_step(): 1.0
2024-12-10 09:22:38.825 INFO (MainThread) [custom_components.gree.climate] fan_list(): ['Auto', 'Low', 'Medium-Low', 'Medium', 'Medium-High', 'High', 'Turbo', 'Quiet']
2024-12-10 09:22:38.825 INFO (MainThread) [custom_components.gree.climate] swing_modes(): ['Default', 'Swing in full range', 'Fixed in the upmost position', 'Fixed in the middle-up position', 'Fixed in the middle position', 'Fixed in the middle-low position', 'Fixed in the lowest position', 'Swing in the downmost region', 'Swing in the middle-low region', 'Swing in the middle region', 'Swing in the middle-up region', 'Swing in the upmost region']
2024-12-10 09:22:38.826 INFO (MainThread) [custom_components.gree.climate] available(): Device is offline
2024-12-10 09:22:38.826 INFO (MainThread) [custom_components.gree.climate] name(): Thermopompe
2024-12-10 09:22:38.826 INFO (MainThread) [custom_components.gree.climate] supported_features(): 425

@lcapriotti
Copy link

lcapriotti commented Jan 10, 2025

same here, new unit, new wifi module very likely:

2025-01-10 15:45:35.821 INFO (SyncWorker_6) [custom_components.gree.climate] update()
2025-01-10 15:45:35.821 INFO (SyncWorker_6) [custom_components.gree.climate] Retrieving HVAC encryption key
2025-01-10 15:45:35.823 INFO (SyncWorker_6) [custom_components.gree.climate] Fetching(192.168.0.161, 7000, 10, {"cid": "app","i": 1,"pack": "<...>","t":"pack","tcid":"<...>","uid": 0, "tag" : "<..>=="})
2025-01-10 15:45:35.824 INFO (SyncWorker_6) [custom_components.gree.climate] 3
2025-01-10 15:45:45.834 INFO (SyncWorker_6) [custom_components.gree.climate] Error getting device encryption key!

climate.yaml:

- platform: gree
  name: GroundFloor AC
  host: 192.168.0.161
  port: 7000
  mac: xx:xx:xx:xx:xx:xx
  encryption_version: 2
  target_temp_step: 1
  disable_available_check: true

@gekkehenkie11
Copy link

gekkehenkie11 commented Jan 14, 2025

most likely this problems
same as to me
#216 (comment)

I read your issue and it does seem similar, however I previously had this device connected and working. It just stopped functioning after a few days, and now won't connect at all.

Ok rewriting this post. I had the same issue as you and solved it. So everything worked and then all of a sudden 2 AC's didnt work anymore (the 3rd kept working). Turned out that this was due to those 2 AC's connecting to my RE230 TPlink wifi extender. What happened is that the extender spoofed the MAC addresses, so it changed the addresses from C0:39:37:XX:XX:XX (which indeed is a GREE MAC address https://macaddress.io/macaddress/C0:39:37) to 46:e0:6d:XX:XX:XX. So once I updated the info in the climate.yaml it all worked again.

So you just need to make sure that the AC's don't connect to a wifi extender that spoofs the MAC, or at least make sure that they ONLY connect to that extender and not directly to the router (getting a different mac address). So use different SSID's to make sure the AC is not switching every time between router and extender and thus also switching MAC addresses. So to be clear, I had assigned the MAC addresses to a static DHCP address in the router but since the TPLINK extender changed the MAC addresses, the router didn't bind them anymore to the 'static' IP I gave them and thus the IP's changed too.... And of course if the device is not anymore on the same IP as in the yaml file it won't work anymore.

Hopefully this helps somebody else too. So 1) make sure that the AC is still on the same IP as specified in your climate.yaml and if that's not the case then 2) make sure that you gave your AC a 'static' DHCP address in your router and that 3) the MAC address wasn't changed by for example a wifi extender.

@Tiger770
Copy link
Author

Tiger770 commented Jan 15, 2025

Interesting. I too am running tp-link hardware. My base station is in the house and out in the workshop is the wireless access point with a different ssid than the house. I will have to check to see if the Mac is being spoofed by the AP, or if it is trying to do something stupid like double NAT for those wireless devices in the same network range.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants