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

Python lib throws error #165

Open
Grothesk242 opened this issue Jul 8, 2022 · 24 comments
Open

Python lib throws error #165

Grothesk242 opened this issue Jul 8, 2022 · 24 comments

Comments

@Grothesk242
Copy link

2022-07-08 22:43:10.418  - info: midea.0 (181878) starting. Version 0.1.0 (non-npm: TA2k/ioBroker.midea#fd51f4b710e826e4c3025c70b7eab0d1f771f101) in /opt/iobroker/node_modules/iobroker.midea, node: v18.4.0, js-controller: 4.0.23
2022-07-08 22:43:28.182  - info: midea.0 (181878) Login successful
2022-07-08 22:43:28.187  - info: midea.0 (181878) Getting devices
2022-07-08 22:43:37.833  - info: midea.0 (181878) Found 1 devices
2022-07-08 22:43:40.892  - error: midea.0 (181878) Error
2022-07-08 22:43:40.893  - error: midea.0 (181878) *** PY ***  Python Error  Call to 'appliance_state' failed:
>                     appliance_state = await this.midea_beautiful.appliance_state$({ cloud: this.cloud, appliance_id: id, use_cloud: true });
  at Midea.updateDevices (/opt/iobroker/node_modules/iobroker.midea/main.js:144:39)
  at Midea.onReady (/opt/iobroker/node_modules/iobroker.midea/main.js:78:9)
... across the bridge ...
> appliance.identify(cloud, use_cloud)
  at appliance_state (/home/iobroker/.local/lib/python3.9/site-packages/midea_beautiful/lan.py:1025)
> self.refresh(cloud if use_cloud else None)
  at identify (/home/iobroker/.local/lib/python3.9/site-packages/midea_beautiful/lan.py:810)
> responses = self._status(cmd, cloud)
  at refresh (/home/iobroker/.local/lib/python3.9/site-packages/midea_beautiful/lan.py:381)
> responses = cloud.appliance_transparent_send(self.appliance_id, data)
  at _status (/home/iobroker/.local/lib/python3.9/site-packages/midea_beautiful/lan.py:538)
> response = self.api_request(
  at appliance_transparent_send (/home/iobroker/.local/lib/python3.9/site-packages/midea_beautiful/cloud.py:526)
> self.handle_api_error(int(payload[error_code_tag]), payload["msg"])
  at api_request (/home/iobroker/.local/lib/python3.9/site-packages/midea_beautiful/cloud.py:302)
> handler()
  at handle_api_error (/home/iobroker/.local/lib/python3.9/site-packages/midea_beautiful/cloud.py:645)
> raise CloudError(error, message)
  at cloud_error (/home/iobroker/.local/lib/python3.9/site-packages/midea_beautiful/cloud.py:630)
*** JS *** midea_beautiful.exceptions.CloudError: Midea cloud API error: None (1000)
@TA2k
Copy link
Owner

TA2k commented Jul 8, 2022

I created a ticket on the library.
nbogojevic/midea-beautiful-air#11
You are using an AC on MSmartHome?

@Grothesk242
Copy link
Author

You are using an AC on MSmartHome?

Yes, I do.

@TA2k
Copy link
Owner

TA2k commented Jul 14, 2022

Can you please reinstall the adapter via GitHub. the library received an update maybe this is now solved

@Grothesk242
Copy link
Author

Github is not updated yet.

iobroker.midea@0.1.0 (git+ssh://git@github.com/TA2k/ioBroker.midea.git#fd51f4b710e826e4c3025c70b7eab0d1f771f101)

@TA2k
Copy link
Owner

TA2k commented Jul 14, 2022

This is correct. But it will trigger a reinstall of the python module wich leads to an updated python module

@Grothesk242
Copy link
Author

Yes, I realized it some seconds after my post... :-)
But no improvement:

2022-07-14 11:27:45.407  - info: midea.0 (34167) starting. Version 0.1.0 (non-npm: TA2k/ioBroker.midea) in /opt/iobroker/node_modules/iobroker.midea, node: v18.6.0, js-controller: 4.0.23
2022-07-14 11:27:53.191  - info: midea.0 (34167) Login successful
2022-07-14 11:27:53.193  - info: midea.0 (34167) Getting devices
2022-07-14 11:28:07.738  - info: midea.0 (34167) Found 1 devices
2022-07-14 11:28:07.756  - info: midea.0 (34167) Missing ip for 142936511632453 device update via cloud
2022-07-14 11:28:10.620  - error: midea.0 (34167) Error
2022-07-14 11:28:10.621  - error: midea.0 (34167) *** PY ***  Python Error  Call to 'appliance_state' failed:
>                         appliance_state = await this.midea_beautiful.appliance_state$({ cloud: this.cloud, appliance_id: id, use_cloud: true });
  at Midea.updateDevices (/opt/iobroker/node_modules/iobroker.midea/main.js:141:43)
  at Midea.onReady (/opt/iobroker/node_modules/iobroker.midea/main.js:78:9)
... across the bridge ...
> appliance.identify(cloud, use_cloud)
  at appliance_state (/home/iobroker/.local/lib/python3.9/site-packages/midea_beautiful/lan.py:1041)
> self.refresh(cloud if use_cloud else None)
  at identify (/home/iobroker/.local/lib/python3.9/site-packages/midea_beautiful/lan.py:826)
> responses = self._status(cmd, cloud)
  at refresh (/home/iobroker/.local/lib/python3.9/site-packages/midea_beautiful/lan.py:381)
> responses = cloud.appliance_transparent_send(self.appliance_id, data)
  at _status (/home/iobroker/.local/lib/python3.9/site-packages/midea_beautiful/lan.py:538)
> response = self.api_request(
  at appliance_transparent_send (/home/iobroker/.local/lib/python3.9/site-packages/midea_beautiful/cloud.py:526)
> self.handle_api_error(int(payload[error_code_tag]), payload["msg"])
  at api_request (/home/iobroker/.local/lib/python3.9/site-packages/midea_beautiful/cloud.py:302)
> handler()
  at handle_api_error (/home/iobroker/.local/lib/python3.9/site-packages/midea_beautiful/cloud.py:645)
> raise CloudError(error, message)
  at cloud_error (/home/iobroker/.local/lib/python3.9/site-packages/midea_beautiful/cloud.py:630)
*** JS *** midea_beautiful.exceptions.CloudError: Midea cloud API error: None (1000)
2022-07-14 11:33:10.623  - info: midea.0 (34167) Missing ip for 142936511632453 device update via cloud
2022-07-14 11:33:14.191  - error: midea.0 (34167) Error
2022-07-14 11:33:14.193  - error: midea.0 (34167) *** PY ***  Python Error  Call to 'appliance_state' failed:
>                         appliance_state = await this.midea_beautiful.appliance_state$({ cloud: this.cloud, appliance_id: id, use_cloud: true });
  at Midea.updateDevices (/opt/iobroker/node_modules/iobroker.midea/main.js:141:43)
... across the bridge ...
> appliance.identify(cloud, use_cloud)
  at appliance_state (/home/iobroker/.local/lib/python3.9/site-packages/midea_beautiful/lan.py:1041)
> self.refresh(cloud if use_cloud else None)
  at identify (/home/iobroker/.local/lib/python3.9/site-packages/midea_beautiful/lan.py:826)
> responses = self._status(cmd, cloud)
  at refresh (/home/iobroker/.local/lib/python3.9/site-packages/midea_beautiful/lan.py:381)
> responses = cloud.appliance_transparent_send(self.appliance_id, data)
  at _status (/home/iobroker/.local/lib/python3.9/site-packages/midea_beautiful/lan.py:538)
> response = self.api_request(
  at appliance_transparent_send (/home/iobroker/.local/lib/python3.9/site-packages/midea_beautiful/cloud.py:526)
> self.handle_api_error(int(payload[error_code_tag]), payload["msg"])
  at api_request (/home/iobroker/.local/lib/python3.9/site-packages/midea_beautiful/cloud.py:302)
> handler()
  at handle_api_error (/home/iobroker/.local/lib/python3.9/site-packages/midea_beautiful/cloud.py:645)
> raise CloudError(error, message)
  at cloud_error (/home/iobroker/.local/lib/python3.9/site-packages/midea_beautiful/cloud.py:630)
*** JS *** midea_beautiful.exceptions.CloudError: Midea cloud API error: None (1000)
2022-07-14 11:38:10.624  - info: midea.0 (34167) Missing ip for 142936511632453 device update via cloud
2022-07-14 11:38:12.311  - error: midea.0 (34167) Error
2022-07-14 11:38:12.312  - error: midea.0 (34167) *** PY ***  Python Error  Call to 'appliance_state' failed:
>                         appliance_state = await this.midea_beautiful.appliance_state$({ cloud: this.cloud, appliance_id: id, use_cloud: true });
  at Midea.updateDevices (/opt/iobroker/node_modules/iobroker.midea/main.js:141:43)
... across the bridge ...
> appliance.identify(cloud, use_cloud)
  at appliance_state (/home/iobroker/.local/lib/python3.9/site-packages/midea_beautiful/lan.py:1041)
> self.refresh(cloud if use_cloud else None)
  at identify (/home/iobroker/.local/lib/python3.9/site-packages/midea_beautiful/lan.py:826)
> responses = self._status(cmd, cloud)
  at refresh (/home/iobroker/.local/lib/python3.9/site-packages/midea_beautiful/lan.py:381)
> responses = cloud.appliance_transparent_send(self.appliance_id, data)
  at _status (/home/iobroker/.local/lib/python3.9/site-packages/midea_beautiful/lan.py:538)
> response = self.api_request(
  at appliance_transparent_send (/home/iobroker/.local/lib/python3.9/site-packages/midea_beautiful/cloud.py:526)
> self.handle_api_error(int(payload[error_code_tag]), payload["msg"])
  at api_request (/home/iobroker/.local/lib/python3.9/site-packages/midea_beautiful/cloud.py:302)
> handler()
  at handle_api_error (/home/iobroker/.local/lib/python3.9/site-packages/midea_beautiful/cloud.py:645)
> raise CloudError(error, message)
  at cloud_error (/home/iobroker/.local/lib/python3.9/site-packages/midea_beautiful/cloud.py:630)
*** JS *** midea_beautiful.exceptions.CloudError: Midea cloud API error: None (1000)

@TA2k
Copy link
Owner

TA2k commented Jul 14, 2022

Ok thanks

@Grothesk242
Copy link
Author

Hab es über CLI hinbekommen über die lib mit der Klimaanlage zu quatschen:
Ich habe mir per

sudo -u iobroker ./midea-beautiful-air-cli discover --account EMAIL --password PASSWORT --credentials --app MSmartHome 

ein Token sowie einen Key abgeholt. Wichtig ist die Angabe der verwendeten App, sonst wird wohl die Midea Air App angefragt.

MIt dem Token und dem Key kann man dann mit dem Gerät quatschen, z. B. einschalten:

sudo -u iobroker ./midea-beautiful-air-cli set --ip 192.168.178.56 --token MEINLANGESGEHEIMESTOKEN --key MEINGEHEIMERKEY --running 1

@Grothesk242
Copy link
Author

attribute arguments:
  --beep-prompt BEEP_PROMPT
                        turn beep prompt on/off (dehumidifier, air conditioner)
  --fan-speed FAN_SPEED
                        Current fan speed (dehumidifier, air conditioner)
  --ion-mode ION_MODE   ion (anion) mode on/off (dehumidifier)
  --mode MODE           operating mode (dehumidifier, air conditioner)
  --pump PUMP           water pump on/off (dehumidifier)
  --pump-switch-flag PUMP_SWITCH_FLAG
                        Pump switch flag - Disables pump (dehumidifier)
  --running RUNNING     turn on/off (dehumidifier, air conditioner)
  --sleep-mode SLEEP_MODE
                        sleep mode on/off (dehumidifier)
  --target-humidity TARGET_HUMIDITY
                        Target humidity (dehumidifier)
  --vertical-swing VERTICAL_SWING
                        vertical swing mode on/off (dehumidifier, air conditioner)
  --comfort-sleep COMFORT_SLEEP
                        sleep comfort mode on/off (air conditioner)
  --dryer DRYER         dryer mode on/off (air conditioner)
  --eco-mode ECO_MODE   eco mode on/off (air conditioner)
  --fahrenheit FAHRENHEIT
                        use Fahrenheit degrees (air conditioner)
  --horizontal-swing HORIZONTAL_SWING
                        fan left/right swing on/off (air conditioner)
  --purifier PURIFIER   dryer mode on/off (air conditioner)
  --show-screen SHOW_SCREEN
                        display on/off (air conditioner)
  --target-temperature TARGET_TEMPERATURE
                        A/C target temperature (air conditioner)
  --turbo TURBO         turbo (boost) mode on/off (air conditioner)
  --turbo-fan TURBO_FAN
                        turbo fan mode on/off (air conditioner)

@TA2k
Copy link
Owner

TA2k commented Jul 14, 2022

ja set sollte auch soweit gehen aber der cli Befehl status sollte auch fehlschlagen.
Die Information von discover müssten auch im iobroker stehen sind
Wäre gut ob du über discover die address, token und key bekommst und ob die auch im ioBroker stehen

@Grothesk242
Copy link
Author

So ganz verstehe ich das nicht. Den discover hab ich ja erfolgreich über CLI abgesetzt, daraufhin erschienen im Output (mindestens) zwei neue Zeilen, eine mit dem Token, eine weitere mit einem Key. Wie soll ich das denn in den ioBroker bekommen, ich hab ja nur die CLI.

@Grothesk242
Copy link
Author

Grothesk242 commented Jul 14, 2022

Der Unterschied ist nur die Ausgabe des Tokens/Key-Paares

discover mit --credentials :

echad@chet:/home/iobroker/.local/bin $ sudo -u iobroker ./midea-beautiful-air-cli discover --account EMAIL@EMAIL.COM --password xxxxxxxxxxxxxxx --credentials --app MSmartHome
id 000000P0000000Q1A88C111111BE0000/123456789123456
  id      = 123456789123456
  addr    = 192.168.178.56
  s/n     = 000000P0000000Q1A88C111111BE0000
  model   = Air conditioner
  ssid    = net_ac_12AB
  online  = True
  name    = Klimaanlage
  running = False
  target  = 25.0
  indoor  = 29.5
  outdoor = 2.2250738585072014e-308
  fan     = 102
  mode    = 2
  purify  = False
  eco     = False
  sleep   = False
  F       = False
  error   = 0
  supports= {'eco': 0, 'mode': 5, 'fan_swing': 2, 'anion': 0, 'filter_reminder': 2, 'strong_fan': 2, 'fan_speed': 4, 'temperature0': 34, 'temperature1': 60, 'temperature2': 34, 'temperature3': 60, 'temperature4': 34, 'temperature5': 60, 'temperature6': 0, 'screen_display': 1}
  version = 3
  token   = MEGAGEHEIMESTOKEN
  key     = GEHEIMERKEY

discover ohne --credentials :

echad@chet:/home/iobroker/.local/bin $ sudo -u iobroker ./midea-beautiful-air-cli discover --account  --password --app
 MSmartHome
id 000000P0000000Q1A88C111111BE0000/123456789123456
  id      = 123456789123456
  addr    = 192.168.178.56
  s/n     = 000000P0000000Q1A88C111111BE0000
  model   = Air conditioner
  ssid    = net_ac_12AB
  online  = True
  name    = Klimaanlage
  running = False
  target  = 25.0
  indoor  = 29.5
  outdoor = 2.2250738585072014e-308
  fan     = 102
  mode    = 2
  purify  = False
  eco     = False
  sleep   = False
  F       = False
  error   = 0
  supports= {'eco': 0, 'mode': 5, 'fan_swing': 2, 'anion': 0, 'filter_reminder': 2, 'strong_fan': 2, 'fan_speed': 4, 'temperature0': 34, 'temperature1': 60, 'temperature2': 34, 'temperature3': 60, 'temperature4': 34, 'temperature5': 60, 'temperature6': 0, 'screen_display': 1}
  version = 3

@TA2k
Copy link
Owner

TA2k commented Jul 14, 2022

Wie sieht das Objekt im iobroker aus?
midea.0.123432432432432

@Grothesk242
Copy link
Author

Grothesk242 commented Jul 14, 2022

Kommt durch, aber ich kann da nichts schalten.

2022-07-14 21_07_04-objects - chet

@TA2k
Copy link
Owner

TA2k commented Jul 14, 2022

Gibt es auch address und token

@TA2k
Copy link
Owner

TA2k commented Jul 14, 2022

Installier nochmal via GitHub und schau im debug log ob er versucht das richtige Element zu setzen

@Grothesk242
Copy link
Author

Dep midea-beautiful-air wurde gebumpt:
Bump version: 0.9.14 → 0.9.15 nbogojevic/midea-beautiful-air@76e1bd2

Kannst du mal schauen ob es Verbesserungen gab?

@TA2k
Copy link
Owner

TA2k commented Sep 2, 2022

Nein leider nicht sinnvolles. es wundert mich sehr warum er nicht auf das issue reagiert

@Grothesk242
Copy link
Author

Grothesk242 commented Sep 3, 2022

Vielleicht versteht er nicht worum es geht. Ich tu es nämlich auch nicht. Aber das heißt natürlich nichts.

@Grothesk242
Copy link
Author

Grothesk242 commented Sep 16, 2022

Was ich aber auch nicht verstehe: Über CLI funktioniert es ja bei mir, kann man das nicht im Adapter 'umschließen'?

@TA2k
Copy link
Owner

TA2k commented Sep 16, 2022

Ja werde ich dann machen. Die cli macht immer ein anfangs request und kein update. habe halt nur gehofft das er es fixt
Aber ich schaue mal ob ich es in der python lib fixe

@Grothesk242
Copy link
Author

Hi, so langsam wird es ja wärmer und die Klimaanlage wird wieder hervorgekramt. Konntest du in die python lib schon mal reinschauen?

@TA2k
Copy link
Owner

TA2k commented Jun 7, 2023

die beautiful air wird nicht weiter entwickelt
https://github.com/georgezhao2010/midea_ac_lan
wäre besser aber die ist leider nicht so modular aufgebaut muss ich mir mal anschauen

@Grothesk242
Copy link
Author

midea-beautiful-air-cli funktioniert hier ja. Ich schau mal ob ich daraus irgendwie per blockly und exec midea-beautiful-air-cli was gebastelt bekomme.

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

2 participants