Package: pyelectroluxconnect
pyelectroluxconnectPython client package to communicate with the Electrolux Connectivity Platform (ECP) used by some home appliances, Electrolux owned brands, like:Electrolux,AEG,Frigidaire,Husqvarna.
Tested with AEG washer-dryer, but probably could be used with some internet connected ovens, diswashers, fridges, airconditioners.It is general client, and all parameters (called HACL), that can be read or set, names and translations are dynamically generated, based on appliance profile file, downloaded from ECP servers.CompatibilityThis package is compatibile with home appliances registered with one of this ECP based mobile apps:EMEA region:My AEG Care (Google Play,App Store)My Electrolux Care (Google Play,App Store)My AEG Kitchen (Google Play,App Store)My Electrolux Kitchen (Google Play,App Store)APAC region:Electrolux Life (Google Play,App Store)LATAM region:Electrolux Home+ (Google Play,App Store)NA region:Electrolux Oven (Google Play,App Store)Frigidaire:Frigidaire 2.0 (Google Play,App Store)Unsupported devicesThis packageis notcompatibile with appliances controlled with this mobile apps:Electrolux (Google Play,App Store)AEG (Google Play,App Store)Frigidaire (Google Play,App Store)Electrolux Wellbeing (Google Play,App Store)AEG Wellbeing (Google Play,App Store)Electrolux Home Comfort (Google Play,App Store)AEG Home Comfort (Google Play,App Store)Electrolux AirCare (Google Play,App Store)Electrolux Wifi ControlBox (Google Play,App Store)Featureslist appliances paired with Electrolux accountget appliance profile with translationsget appliance statesend command to applianceregister/unregister Client with Electrolux MQTT cloud based brokerUsageInitiate sessionTo use this library, there's an account with Electrolux/AEG/Frigidaire app must be created. By default, library is using EMEA region apps credentials. If account is created in other region app,regionparameter must be set. If created account is not supported, You can manually setregionServer,customApiKeyandcustomApiBrandparameters (from sniffed traffic or extracted from mobile app).importpyelectroluxconnectses=pyelectroluxconnect.Session(username,password,region="emea",tokenFileName=".electrolux-token",country="US",language=None,deviceId="CustomDeviceId",verifySsl=True,regionServer=None,customApiKey=None,customApiBrand=None)or minimal input set:importpyelectroluxconnectses=pyelectroluxconnect.Session(username,password)where:username, password- ECP (Electrolux site) credentialstokenFileName- file to store auth token (default:~/.electrolux-token)region- account region (defaltemea. Tested withemea,apac,na,latam,frigidaire)country- 2-char country code (defaultUS)language- 3-char language code for translations (All- for all delivered languages, default:None)deviceId- custom id of client used in ECP, should be unique for every client instance (default:CustomDeviceId)verifySsl- verify ECP servers certs (default:True)regionServer- region server URL (default is based on selected region)customApiKey- custom value of "x-ibm-client-id" and "x-api-key" HTTP headers (default is based on selected region)customApiBrand- custom "brand" value (default is based on selected region)Login to ECPses.login()Get list of appliances registered to Electrolux accountappllist=ses.getAppliances()print(appllist)Get appliances connection stateforapplianceinappllist:print(ses.getApplianceConnectionState(appliance))Get appliance profileList of parameters (HACL's) with allowed values, translations, etc... Note, that not all parameters can be read, or set over ECP.Each parameter is in "module:hacl" form. Module is internal appliance module symbol, hacl is parameter hex symbol, that can be read from or set to module.print(ses.getApplianceProfile(appliance))Get appliance latest state from ECPGet latest appliance state from ECP. When appliance is online, current state updates are available over Internet withMQTTprotocol. To get credentials to connect any MQTT client to ECP MQTT broker, useregisterMQTT()method.to get latest state from a platform:print(ses.getApplianceState(appliance,paramName=None,rawOutput=False))paramName- comma separated list of patrameter names (None(default) for all params)rawOutput- get list of parameters in received form.False(default): parse output to more friendly form (with translations, etc)Send param value to applianceSend value to appliance (list of supported appliance destinations (destination) and parameters (hacl) with allowed values (value), You can get withgetApplianceProfile()method):ses.setHacl(appliance,hacl,value,destination)hacl- hex number of param (HACL)value- value to set (it could be number or list of parameters (for container HACL type))destination- destination module name, from profile path (NIU,WD1, etc...)washer-dryer examples:set Wash+Dry "Cottons" program, with "Extra Dry" dryness Level:ses.setHacl(appliance,"0x1C09",[{"50":"0x0000"},{"12":"128"},{"6.32":1},{"6.33":1}],"WD1")pause program:ses.setHacl(appliance,"0x0403",4,"WD1")Register client to MQTT brokerprint(ses.registerMQTT())returns parameters required to login to Electrolux MQTT broker with any MQTT client:Url- Host of MQTT broker (with port number)OrgId- Organization IDClientID- MQTT Client IDDeviceToken- Token required to authentication (for IBM broker, use stringuse-token-authas username, DeviceToken as password)List of MQTT topics (QoS = 0) to subscribe:iot-2/cmd/live_stream/fmt/+iot-2/cmd/feature_stream/fmt/+Unregister client from MQTT brokerses.unregisterMQTT()Parse received MQTT messageprint(ses.getMqttState(mqttJsonPayload))Parse message from MQTT broker, and return in getApplianceState(...) like form.mqttJsonPayload- MQTT message payload in JSON form.Very simple MQTT example to receive online appliance state changes from ECP MQTT brokerPlease Note: Electrolux moved MQTT broker from IBM servers. After that, this code is not valid.importpaho.mqtt.clientasmqttimportpyelectroluxconnectdefon_connect(client,userdata,flags,rc):print("Connected with result code "+str(rc))client.subscribe("iot-2/cmd/live_stream/fmt/json",0)defon_message(client,userdata,msg):print(ses.getMqttState(msg.payload))ses=pyelectroluxconnect.Session(login,passwd,language="pol",region="emea",deviceId='MQTTHA2')ses.login()mqtt_params=ses.registerMQTT()client=mqtt.Client(client_id=mqtt_params["ClientID"])client.tls_set(ca_certs=ses.getSSLCert())client.username_pw_set("use-token-auth",mqtt_params["DeviceToken"])client.on_connect=on_connectclient.on_message=on_messageclient.connect(mqtt_params["Url"].split(":")[0],int(mqtt_params["Url"].split(":")[1]),60)whileTrue:client.loop()DisclaimerThis library was not made by AB Electrolux. It is not official, not developed, and not supported by AB Electrolux.