Code Monkey home page Code Monkey logo

ha-smartthinq-sensors's Introduction

LG ThinQ Devices integration for HomeAssistant

hacs_badge

A HomeAssistant custom integration to monitor and control LG devices using ThinQ API based on WideQ project.

Supported devices are:

  • Air Conditioner
  • Air Purifier
  • Dehumidifier
  • Dishwasher
  • Dryer
  • Fan
  • Hood
  • Microwave
  • Range
  • Refrigerator
  • Styler
  • Tower Washer-Dryer
  • Washer
  • Water Heater

Important: The component will not work if you have logged into the ThinQ application and registered your devices using a social network account (Google, Facebook or Amazon). In order to use the component you need to create a new independent LG account and make sure you log into the ThinQ app and associate your devices with it. If during configuration you receive the message "No SmartThinQ devices found", probably your devices are still associated with the social network account. To solve the problem perform the following step:

  • remove your devices from the ThinQ app
  • logout from the app and login again with the independent LG account
  • reconnect the devices in the app

Important 2: If you receive an "Invalid Credential" error during component configuration/startup, check in the LG mobile app if is requested to accept new Term Of Service.

Note: some device status may not be correctly detected, this depends on the model. I'm working to map all possible status developing the component in a way to allow to configure model option in the simplest possible way and provide update using Pull Requests. I will provide a guide on how update this information.

Installation

You can install this component in two ways: via HACS or manually.

Option A: Installing via HACS

If you have HACS, just go in the Integration Tab and search the "SmartThinQ LGE Sensors" component and install it.

Option B: Manual installation (custom_component)

Prerequisite: SSH into your server. Home Assistant Add-on: SSH server

  1. Clone the git master branch. git clone https://github.com/ollo69/ha-smartthinq-sensors.git

  2. If missing, create a custom_components directory where your configuration.yaml file resides. This is usually in the config directory of homeassistant. mkdir ~/.homeassistant/custom_components

  3. Copy the smartthinq_sensors directory within the custom_components directory of your homeassistant installation from step 2. cp -R ha-smartthinq-sensors/custom_components/smartthinq_sensors/ ~/.homeassistant/custom_components

  4. (Optional) Delete the git repo. rm -Rf ha-smartthinq-sensors/

    After a correct installation, your configuration directory should look like the following.

        └── ...
        └── configuration.yaml
        └── secrets.yaml
        └── custom_components
            └── smartthinq_sensors
                └── __init__.py
                └── config_flow.py
                └── const.py
                └── ...
  5. Reboot HomeAssistant

Component configuration

Once the component has been installed, you need to configure it using the web interface in order to make it work.

  1. Go to "Settings->Devices & Services".
  2. Hit shift-reload in your browser (this is important!).
  3. Click "+ Add Integration".
  4. Search for "SmartThinQ LGE Sensors"
  5. Select the integration and Follow setup workflow

Important: use your country and language code: SmartThinQ accounts are associated with a specific locale, so be sure to use the country and language you originally created your account with. Reference for valid code:

Docs

In this example, "My [insert thing]" will just be the placeholder

Entities

Entity ID Entity Name Description
sensor.my_washer My Washer Washer, turns On when on, turns Off when off
binary_sensor.my_washer_wash_completed My Washer Wash Completed Turns On when washer completed wash. You can use it in automations by triggering them when it goes from Off to On.
binary_sensor.my_washer_error_state My Washer Error State Off/OK means that it's fine. On/Error means there's an error.
sensor.my_dryer My Dryer Dryer, turns On when on, turns Off when off
binary_sensor.my_dryer_dry_completed My Dryer Dry Completed Turns On when dryer completed wash. You can use it in automations by triggering them when it goes from Off to On.
binary_sensor.my_dryer_error_state My Dryer Error State Off/OK means that it's fine. On/Error means there's an error.

Attributes sensor.my_washer

Note: When something doesn't apply and/or is off, it may have a - as its value. Also, these are for @KTibow's washer, values may differ for yours. Feel free to open an issue/PR.

Hidden, click to expand
Attribute ID Description
model Model ID of washer
mac_address Mac address of washer
run_completed Turns On when washer completed wash, just like binary_sensor.my_washer_wash_completed.
error_state Off/OK means that it's fine. On/Error means there's an error, just like binary_sensor.my_washer_error_state.
error_message When there is an error, this is what it is. (Format unknown)
run_state Current state of washer in words
pre_state Previous state of washer in words
current_course Current washing cycle in words
spin_speed Current cycle's spin mode in words
water_temp Current cycle's water temperature in words
dry_level Unknown attribute, might be used in combined washers and dryers for the current cycle's dry level
tubclean_count How many cycles have been ran without running the Tub Clean cycle
remain_time How much more time is remaining, H:MM
initial_time The orginal amount of time, H:MM
reserve_time When in Delay Start mode, the delay amount, H:MM
door_lock Whether washer door is locked, on/off
child_lock Whether child lock is on, on/off
remote_start Whether remote start is enabled, on/off
steam Whether steam is enabled on supported washers, on/off
pre_wash Whether using prewash cycle, on/off
turbo_wash Whether Turbowash is enabled, on/off

Attributes sensor.my_dryer

Note: When something doesn't apply and/or is off, it may have a - as its value. Also, these are for @KTibow's dryer, values may differ for yours. Feel free to open an issue/PR.

Hidden, click to expand
Attribute ID Description
model Model ID of dryer
mac_address Mac address of dryer
run_completed Turns On when dryer completed dry, just like binary_sensor.my_dryer_dry_completed.
error_state Off/OK means that it's fine. On/Error means there's an error, just like binary_sensor.my_dryer_error_state.
error_message When there is an error, this is what it is. (Format unknown)
run_state Current state of dryer in words
pre_state Previous state of dryer in words
current_course Current drying cycle in words
temp_control Current option for dryer temperature in words
dry_level Current level for how much to dry
remain_time How much more time is remaining, H:MM
initial_time The orginal amount of time, H:MM
reserve_time Unknown attribute, it could be this behaves the same as the washer's reserve_time, H:MM
child_lock Child lock, on/off

Examples (washer/dryer)

  • Get a notification when the clothes are done drying (or when the clothes are done washing, automation)
- id: 'dry_clothes_notification'
  alias: "Dry clothes notification"
  description: "Alert when dryer finishes"
  trigger:
  - entity_id: binary_sensor.my_dryer_dry_completed
    platform: state
    to: 'on'
  condition: []
  action:
  - data:
      title: "The clothes are dry!"
      message: "Get them while they're hot!"
    service: notify.notify

You can substitute "dry" and "dryer" for "wet" and "washer" if you want to use with a washer, for example.

image

Code hidden, click to expand
type: custom:timer-bar-card
entity: sensor.my_washer # replace with your entity name
duration:
  attribute: initial_time
invert: true # if you like to show the progress bar reverse like the screenshot above shows
bar_height: 11px # adjusts the height of the bar
text_width: 4em # adjusts the text width
  • Custom card for dryer and washer

image

Code hidden, click to expand

Ensure that advance mode is enabled for your account else you won't see the resources page. Your User > Advanced Mode. Toggle to true.

Place this file in /config/www/laundry.js, and add a custom resource in HA UI > Sidebar > Config > Dashboards > Resources > Plus > Add /local/laundry.js.

In newer HA versions, you can find the custom resource page in HA UI > Sidebar > Settings > Dashboards > [3-dots, top right] > Resources + Add Resources > Add /local/laundry.js

class LaundryCard extends HTMLElement {
  // Whenever states are updated
  set hass(hass) {
    const entityId = this.config.entity;
    const state = hass.states[entityId];
    // Set data definitions
    const friendlyName = state.attributes["friendly_name"] || state.entity_id;
    const icon = state.attributes["icon"];
    if (!this.content) {
      this.innerHTML = `
        <ha-card header="${friendlyName}">
          <div class="main">
            <ha-icon icon="${icon}"></ha-icon>
            <span></span>
          </div>
        </ha-card>
      `;
      this.querySelector(".main").style.display = "grid";
      this.querySelector(".main").style.gridTemplateColumns = "33% 64%";
      this.querySelector("ha-icon").style.setProperty("--mdc-icon-size", "95%");
    }
    if (state.state == "on") {
      const totalTime = state.attributes["initial_time"];
      const remainTime = state.attributes["remain_time"];
      const totalMinutes = (parseInt(totalTime.split(":")[0]) * 60) + parseInt(totalTime.split(":")[1]);
      const remainMinutes = (parseInt(remainTime.split(":")[0]) * 60) + parseInt(remainTime.split(":")[1]);
      this.querySelector("ha-icon").style.color = "#FDD835";
      this.querySelector("span").innerHTML = `
${friendlyName} is running ${state.attributes["current_course"]}<br>
Currently ${state.attributes["run_state"]}<br>
${state.attributes["initial_time"]} total, ${state.attributes["remain_time"]} to go
<div class="progress-wrapper" style="height: 20px; width: 100%;">
  <div class="progress" style="display: inline-block; height: 20px;">
  </div>
  <span style="color: #FFFFFF; position: absolute; right: 33%;">50%</span>
</div>
`;
      this.querySelector(".progress-wrapper").style.backgroundColor = "#44739E";
      this.querySelector(".progress").style.backgroundColor = "#FDD835";
      this.querySelector(".progress").style.width = (totalMinutes - remainMinutes) / totalMinutes * 100 + "%";
      this.querySelector(".progress-wrapper span").innerHTML = Math.round((totalMinutes - remainMinutes) / totalMinutes * 100) + "%";
    } else {
      this.querySelector("ha-icon").style.color = "#44739E";
      this.querySelector("span").innerHTML = `${friendlyName} is off`;
    }
  }

  // On updated config
  setConfig(config) {
    const states = document.querySelector("home-assistant").hass.states;
    if (!config.entity || !states[config.entity] || !states[config.entity].state) {
      throw new Error("You need to define an valid entity (eg sensor.my_washing_machine)");
    }
    this.config = config;
  }

  // HA card size to distribute cards across columns, 50px
  getCardSize() {
    return 3;
  }

  // Return default config
  static getStubConfig() {
    for (var state of Object.values(document.querySelector("home-assistant").hass.states)) {
      if (state.attributes["run_state"] !== undefined) {
        return { entity: state.entity_id };
      }
    }
    return { entity: "sensor.my_washing_machine" };
  }
}

customElements.define('laundry-card', LaundryCard);
window.customCards.push(
  {
    type: "laundry-card",
    name: "Laundry Card",
    preview: true
  }
);

Lovelace:

type: 'custom:laundry-card'
entity: 'sensor.the_dryer_dryer' # Washers work too!
  • Mushroom-card

)

Code hidden, click to expand

Note: You'll need to change the sensor.dryer to your own entity, and you might want to change mdi:tumble-dryer to mdi:washing-machine for washers.

type: custom:mushroom-template-card
primary: Dryer
secondary: >-
  {% if is_state("sensor.dryer", "on") %}

  Running {{ state_attr("sensor.dryer", "current_course") }}

  Currently {{ state_attr("sensor.dryer", "run_state") }}

  {{ state_attr("sensor.dryer", "initial_time") }} total, {{ state_attr("sensor.dryer", "remain_time") }} to go

  {% else %}

  Off

  {% endif %}
icon: mdi:tumble-dryer
entity: sensor.dryer
multiline_secondary: true
icon_color: '{{ "indigo" if is_state("sensor.dryer", "on") else "" }}'
tap_action:
  action: more-info
Code hidden, click to expand

configuration.yaml:

sensor:
  - platform: template
    sensors:
      washer_cycle_state:
        value_template: '{{state_attr(''sensor.my_washer'', ''remain_time'')}}'
        friendly_name: Washer Cycle State
        icon_template: 'mdi:washing-machine'

lovelace:

cards:
  - type: conditional
    conditions:
      - entity: sensor.my_washer
        state: "on"
    card:
      aspect_ratio: '1'
      entity: sensor.washer_cycle_state
      image: /local/washerrunning.gif
      type: picture-entity
  - type: conditional
    conditions:
      - entity: sensor.my_washer
        not_state: "on"
    card:
      aspect_ratio: '1'
      entity: sensor.my_washer
      image: /local/washer.jpg
      type: picture-entity
type: vertical-stack

Obtaining API Information

For troubleshooting issues, or investigating potential new devices, information can be intercepted from the API via a man-in-the-middle (MITM) http proxy interception method. Charles, mitmproxy, and Fiddler are examples of software that can be used to perform this mitm 'attack'/observation.

This can be done using a physical or virtual device that can run the LG ThinQ app. While it is theoretically possible with iOS, it is much easier to do this using Android.

Windows 11 enables the ability to run Android apps on most modern machines, making this process more accessible by eliminating the need for a physical device or separate emulation/virtualization software.

For information on how to do this with Windows Subsystem for Android (WSA) on Windows 11 using mitmproxy, please see the repo zimmra/frida-rootbypass-and-sslunpinning-lg-thinq (Method tested August '23, LG ThinQ Version 4.1.46041)

Be kind

If you like the component, why don't you support me by buying me a coffee? It would certainly motivate me to further improve this work.

Buy me a coffee!

Credits


This component is developed by Ollo69 based on WideQ API. Original WideQ API was developed by Adrian Sampson under license MIT.

ha-smartthinq-sensors's People

Contributors

4homeassistant avatar alani-xx avatar alray31 avatar beardedtinker avatar colohan avatar d3m3vilurr avatar dennisrp avatar dougiteixeira avatar dsimop avatar fnasciment0 avatar greew avatar hisabimbola avatar hwikene avatar jordibsk10 avatar jose1711 avatar kenmaples avatar krzysieklegnica avatar ktibow avatar ldotlopez avatar leandroissa avatar nukusinji avatar oldshaterhan avatar ollo69 avatar petersoniq avatar pistak avatar rainchi avatar skinkie avatar titilambert avatar wrt54g avatar yuvalabou avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

ha-smartthinq-sensors's Issues

Howto for notifications

Hello can you please make a howto showing how to make push notification when washing/dryer machine is finished it sends out a notification to all devices like a iPhone

And also a howto so when it is finished it sends a command to my speakers to say washing machine is now finessed

Make the howto so it’s made for beginners

Only USA accounts can login

I have a Canadian Google Play store (and therefore ThinqQ app) but the login url with the UI provides a US login. Is there any way to get a Canadian URL and use the redirection url to proceed?

Without this the Cell App won't work, which is more important to me anyways.

HA 0.110.1 - Component not loaded at startup

Describe the bug
After upgrade HA to 0.110.1 component is not loaded at startup

Expected behavior
I expect component correctly loaded

Screenshots
image

Environment details:

  • Environment (HASSIO, Raspbian, etc): Raspbian
  • Home Assistant version installed: HA Core 0.110.1
  • Component version installed: 0.4.7
  • Last know working version: 0.4.7 on HA Core 0.100.0
  • LG device type and model with issue: ?
  • LG devices connected (list): Washer

Output of HA logs

2020-05-21 12:57:06 ERROR (MainThread) [homeassistant.setup] Setup failed for smartthinq_sensors: Integration not found.
2020-05-21 12:57:06 DEBUG (MainThread) [homeassistant.core] Bus:Handling <Event call_service[L]: domain=persistent_notification, service=create, service_data=title=Invalid config, message=The following integrations and platforms could not be set up:

 - smartthinq_sensors

Please check your config., notification_id=invalid_config>
2020-05-21 12:57:07 DEBUG (MainThread) [homeassistant.core] Bus:Handling <Event state_changed[L]: entity_id=persistent_notification.invalid_config, old_state=None, new_state=<state persistent_notification.invalid_config=notifying; title=Invalid config, message=The following integrations and platforms could not be set up:

 - smartthinq_sensors

Please check your config. @ 2020-05-21T12:57:07.321591+02:00>>


Additional context

No devices -- SSL Failure

I'm having a problem with this plugin. I recently upgraded my raspberry pi and python to the latest versions and now I cannot access the LG devices. My error log is as follows.

I'm running python 3.8
openssl 1.1.1d
The latest home assistant and the latest ha-smartthinq-sensors

Any help would be greatly appreciated. I have a feeling I need to run an older version openssl, but I'm not technically involved enough to know how to change my version. Thanks for any and all help.

2020-06-10 12:22:46 WARNING (MainThread) [homeassistant.loader] You are using a custom integration for smartthinq_sensors which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant.
2020-06-10 12:22:46 WARNING (MainThread) [homeassistant.loader] You are using a custom integration for hacs which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant.
2020-06-10 12:22:57 ERROR (MainThread) [homeassistant.config_entries] Error setting up entry LGE Devices for smartthinq_sensors
Traceback (most recent call last):
File "/srv/homeassistant/lib/python3.8/site-packages/urllib3/contrib/pyopenssl.py", line 488, in wrap_socket
cnx.do_handshake()
File "/srv/homeassistant/lib/python3.8/site-packages/OpenSSL/SSL.py", line 1934, in do_handshake
self._raise_ssl_error(self._ssl, result)
File "/srv/homeassistant/lib/python3.8/site-packages/OpenSSL/SSL.py", line 1671, in _raise_ssl_error
_raise_current_error()
File "/srv/homeassistant/lib/python3.8/site-packages/OpenSSL/_util.py", line 54, in exception_from_error_queue
raise exception_type(errors)
OpenSSL.SSL.Error: [('SSL routines', 'ssl_choose_client_version', 'unsupported protocol')]

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/srv/homeassistant/lib/python3.8/site-packages/urllib3/connectionpool.py", line 670, in urlopen
httplib_response = self._make_request(
File "/srv/homeassistant/lib/python3.8/site-packages/urllib3/connectionpool.py", line 381, in _make_request
self._validate_conn(conn)
File "/srv/homeassistant/lib/python3.8/site-packages/urllib3/connectionpool.py", line 976, in validate_conn
conn.connect()
File "/srv/homeassistant/lib/python3.8/site-packages/urllib3/connection.py", line 361, in connect
self.sock = ssl_wrap_socket(
File "/srv/homeassistant/lib/python3.8/site-packages/urllib3/util/ssl
.py", line 377, in ssl_wrap_socket
return context.wrap_socket(sock, server_hostname=server_hostname)
File "/srv/homeassistant/lib/python3.8/site-packages/urllib3/contrib/pyopenssl.py", line 494, in wrap_socket
raise ssl.SSLError("bad handshake: %r" % e)
ssl.SSLError: ("bad handshake: Error([('SSL routines', 'ssl_choose_client_version', 'unsupported protocol')])",)

Connection not available. SmartThinQ platform not ready.

Suddenly getting this error in my logs over and over.

2020-06-25 15:59:54 WARNING (MainThread) [custom_components.smartthinq_sensors] Connection not available. SmartThinQ platform not ready.
2020-06-25 15:59:54 WARNING (MainThread) [homeassistant.config_entries] Config entry for smartthinq_sensors not ready yet. Retrying in 80 seconds.

Nothing has changed in HA, other than updating to 111.4
entities are showing as "restored" when looking at them from the integration and clicking on "entities" link.

Invalid redirection URL error

Hello I`m using you add on, I installed it from Hacs and configure by Integrations because I don't have any tokens. I am following your wiki tuto

but at the final of the process I get an
Invalid redirection URL error I try with almost all, includes my hassio duck dns domain.

Could you please help me ? Thanks and best regards

('0110', 'error')

All was working with frige apiv1 and washer apiv2.
Today I recive error
('0110', 'error')
if need i show DEBUG log ....

[BUG] 0.5.0 Washer shows an error state

Describe the bug
After upgrading, washer shows in error state. reinstalling old version resolves the issue. But dryer is fine on both versions.

Washer Error State
Problem

But no error message.

Expected behavior
After upgrading, expected device to stay in non error state.

Screenshots
If applicable, add screenshots to help explain your problem.

Environment details:

  • Environment (HASSIO, Raspbian, etc): VM HASSIO
  • Home Assistant version installed: 0.110.6
  • Component version installed: 0.5.0
  • Last know working version: 0.4.7
  • LG device type and model with issue: Washer - WT7300CV
  • LG devices connected (list): Washer and Dryer (DLE7300VE)

Output of HA logs
Paste the relevant output of the HA log here.

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/config_entries.py", line 217, in async_setup
    hass, self
  File "/usr/src/homeassistant/homeassistant/components/smartthings/__init__.py", line 120, in async_setup_entry
    entry.data[CONF_REFRESH_TOKEN],
  File "/usr/local/lib/python3.7/site-packages/pysmartthings/smartthings.py", line 210, in generate_tokens
    client_id, client_secret, refresh_token
  File "/usr/local/lib/python3.7/site-packages/pysmartthings/api.py", line 424, in generate_tokens
    raise APIInvalidGrant(data.get("error_description"))
pysmartthings.errors.APIInvalidGrant: Invalid refresh token: <TOKEN REMOVED>

Additional context
Add any other context about the problem here.

Odd that there is a refresh token error but Dryer still works fine?

Changing nothing between switching versions. I don't re-setup the integration or anything.

After upgrading and having the issue, I did try to delete/re-setup the integration but that didn't resolve the issue either.

Temp and spin error and showing wrong model

I’m on version V0.3.4
I have 2 problems

In my log I get this error

Log Details (WARNING)
Logger: custom_components.smartthinq_sensors.wideq.device
Source: custom_components/smartthinq_sensors/wideq/device.py:726
First occurred: 10:57:11 PM (2 occurrences)
Last logged: 10:57:11 PM

ThinQ: received unknown WASHER status '@WM_FL24_TITAN_SPIN_SPEED_1000_W' of type 'spin_option'
ThinQ: received unknown WASHER status '@WM_FL24_TITAN_TEMP_60_W' of type 'water_temp'

And in washing machine/dryer it doesn’t show the Temp and also it doesn’t show spinning, I have made a screenshot showing info

And also in one of the pictures showing status it seems it is identifying wrong model of my machine

I have a picture of the tag on my machine showing correct model

image
image
image
image
image

[BUG] Invalid region/language

Describe the bug
Right at the first setup screen after deploying files into HASS, we get the request for region and language.
For my case it is Portugal/Português as I can check on the mobile android app.
However when I try to enter this strings the response is "invalid region format".

Expected behavior
"Portugal" should be accepted for as region and "Português" should be accepted as language.

Screenshots
If applicable, add screenshots to help explain your problem.
image

Environment details:

  • Environment (HASSIO, Raspbian, etc): HA supervised
  • Home Assistant version installed: 0.111.4
  • Component version installed: 0.5.2
  • Last know working version:
  • LG device type and model with issue: washing machine F4J8JS2W
  • LG devices connected (list): just the F4J8JS2W

Output of HA logs
Paste the relavant output of the HA log here.


Additional context
Add any other context about the problem here.

Missing logo brand for hass 0.108 (now beta)

Missing brands for this integration.

https://rc.home-assistant.io/blog/2020/03/27/release-108/

Integration logos & icons
We have created a new repository on GitHub containing all the brand icons and logos Home Assistant is able to integrate with. These images are, for example, used in our documentation.

In 0.108, we made a start on using the content from this repository in the Home Assistant frontend. The device information page got a layout update and the integrations page as well.

These pages will now show the icons and logos matching the integration.

[BUG] Update for sensor.washer failes

Describe the bug
Getting these errors in my logs.

Environment details:

  • Environment (HASSIO, Raspbian, etc): HASSIO
  • Home Assistant version installed: 0.110.2
  • Component version installed: 0.4.7
  • Last know working version: N/A
  • LG device type and model with issue: Washer/WT7800CV
  • LG devices connected (list): Washer, Dryer

Output of HA logs
Paste the relavant output of the HA log here.

2020-06-04 13:39:06 ERROR (MainThread) [homeassistant.helpers.entity] Update for sensor.washer fails
Traceback (most recent call last):
  File "/usr/local/lib/python3.7/site-packages/urllib3/connection.py", line 160, in _new_conn
    (self._dns_host, self.port), self.timeout, **extra_kw
  File "/usr/local/lib/python3.7/site-packages/urllib3/util/connection.py", line 61, in create_connection
    for res in socket.getaddrinfo(host, port, family, socket.SOCK_STREAM):
  File "/usr/local/lib/python3.7/socket.py", line 752, in getaddrinfo
    for res in _socket.getaddrinfo(host, port, family, type, proto, flags):
socket.gaierror: [Errno -3] Try again

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/lib/python3.7/site-packages/urllib3/connectionpool.py", line 677, in urlopen
    chunked=chunked,
  File "/usr/local/lib/python3.7/site-packages/urllib3/connectionpool.py", line 381, in _make_request
    self._validate_conn(conn)
  File "/usr/local/lib/python3.7/site-packages/urllib3/connectionpool.py", line 976, in _validate_conn
    conn.connect()
  File "/usr/local/lib/python3.7/site-packages/urllib3/connection.py", line 308, in connect
    conn = self._new_conn()
  File "/usr/local/lib/python3.7/site-packages/urllib3/connection.py", line 172, in _new_conn
    self, "Failed to establish a new connection: %s" % e
urllib3.exceptions.NewConnectionError: <urllib3.connection.HTTPSConnection object at 0x7faabe0248d0>: Failed to establish a new connection: [Errno -3] Try again

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/lib/python3.7/site-packages/requests/adapters.py", line 449, in send
    timeout=timeout
  File "/usr/local/lib/python3.7/site-packages/urllib3/connectionpool.py", line 725, in urlopen
    method, url, error=e, _pool=self, _stacktrace=sys.exc_info()[2]
  File "/usr/local/lib/python3.7/site-packages/urllib3/util/retry.py", line 439, in increment
    raise MaxRetryError(_pool, url, error or ResponseError(cause))
urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='aic-service.lgthinq.com', port=46030): Max retries exceeded with url: /v1/service/application/dashboard (Caused by NewConnectionError('<urllib3.connection.HTTPSConnection object at 0x7faabe0248d0>: Failed to establish a new connection: [Errno -3] Try again'))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 279, in async_update_ha_state
    await self.async_device_update()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 472, in async_device_update
    await self.hass.async_add_executor_job(self.update)
  File "/usr/local/lib/python3.7/concurrent/futures/thread.py", line 57, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/config/custom_components/smartthinq_washer/sensor.py", line 256, in update
    self._api.device_update()
  File "/usr/src/homeassistant/homeassistant/util/__init__.py", line 239, in wrapper
    result = method(*args, **kwargs)
  File "/config/custom_components/smartthinq_washer/__init__.py", line 330, in device_update
    raise ex
  File "/config/custom_components/smartthinq_washer/__init__.py", line 318, in device_update
    state = self._device.poll()
  File "/config/custom_components/smartthinq_washer/wideq/washer.py", line 29, in poll
    res = self.device_poll("washerDryer")
  File "/config/custom_components/smartthinq_washer/wideq/device.py", line 646, in device_poll
    self._client.refresh_devices()
  File "/config/custom_components/smartthinq_washer/wideq/core_v2.py", line 605, in refresh_devices
    self._load_devices(True)
  File "/config/custom_components/smartthinq_washer/wideq/core_v2.py", line 560, in _load_devices
    self._devices = self._session.get_devices()
  File "/config/custom_components/smartthinq_washer/wideq/core_v2.py", line 421, in get_devices
    devices = self.get2("service/application/dashboard").get("item", [])
  File "/config/custom_components/smartthinq_washer/wideq/core_v2.py", line 413, in get2
    language=self.auth.gateway.language,
  File "/config/custom_components/smartthinq_washer/wideq/core_v2.py", line 133, in thinq2_get
    timeout=DEFAULT_TIMEOUT,
  File "/usr/local/lib/python3.7/site-packages/requests/api.py", line 76, in get
    return request('get', url, params=params, **kwargs)
  File "/usr/local/lib/python3.7/site-packages/requests/api.py", line 61, in request
    return session.request(method=method, url=url, **kwargs)
  File "/usr/local/lib/python3.7/site-packages/requests/sessions.py", line 530, in request
    resp = self.send(prep, **send_kwargs)
  File "/usr/local/lib/python3.7/site-packages/requests/sessions.py", line 643, in send
    r = adapter.send(request, **kwargs)
  File "/usr/local/lib/python3.7/site-packages/requests/adapters.py", line 516, in send
    raise ConnectionError(e, request=request)
requests.exceptions.ConnectionError: HTTPSConnectionPool(host='aic-service.lgthinq.com', port=46030): Max retries exceeded with url: /v1/service/application/dashboard (Caused by NewConnectionError('<urllib3.connection.HTTPSConnection object at 0x7faabe0248d0>: Failed to establish a new connection: [Errno -3] Try again'))

Additional context
Add any other context about the problem here.

LGE Washer: Invalid Login info!

I am receiving the following error in the log after I submit the access token:

Log Details (ERROR)
Logger: custom_components.smartthinq_washer.config_flow
Source: custom_components/smartthinq_washer/config_flow.py:67
First occurred: 10:23:30 PM (2 occurrences)
Last logged: 10:25:06 PM

LGE Washer: Invalid Login info!

Refrigerator- Other Sensors

Hi Ollo,

First of all, thanks for all of your time and effort on this! Got it working in no time and don’t have to use the app anymore! Brilliant!

Just wondering if you were planning to add any additional sensors to this? In particular my refrigerator has the following available:

9B8CCE18-D213-4BE5-9EB9-BAE2A565F669

It would be great if I could see filter status and hygiene fresh status of the fridge?

Let me know if your interested or need any more data and I’ll get it to you.

Thanks again for building this - I’ve been looking for years! 😂

Sensor update failure

Browsing through my logs this morning and noticed the following error in the event it's useful.

HA Version: Home Assistant Core 0.108.6
SmartThinQ Integration: 0.2.4

2020-04-18 08:23:11 ERROR (MainThread) [homeassistant.helpers.entity] Update for sensor.lg_washer fails Traceback (most recent call last): File "/usr/local/lib/python3.7/site-packages/urllib3/connection.py", line 160, in _new_conn (self._dns_host, self.port), self.timeout, **extra_kw File "/usr/local/lib/python3.7/site-packages/urllib3/util/connection.py", line 61, in create_connection for res in socket.getaddrinfo(host, port, family, socket.SOCK_STREAM): File "/usr/local/lib/python3.7/socket.py", line 752, in getaddrinfo for res in _socket.getaddrinfo(host, port, family, type, proto, flags): socket.gaierror: [Errno -3] Try again During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/usr/local/lib/python3.7/site-packages/urllib3/connectionpool.py", line 677, in urlopen chunked=chunked, File "/usr/local/lib/python3.7/site-packages/urllib3/connectionpool.py", line 381, in _make_request self._validate_conn(conn) File "/usr/local/lib/python3.7/site-packages/urllib3/connectionpool.py", line 976, in _validate_conn conn.connect() File "/usr/local/lib/python3.7/site-packages/urllib3/connection.py", line 308, in connect conn = self._new_conn() File "/usr/local/lib/python3.7/site-packages/urllib3/connection.py", line 172, in _new_conn self, "Failed to establish a new connection: %s" % e urllib3.exceptions.NewConnectionError: <urllib3.connection.HTTPSConnection object at 0x7fe3e16e4bd0>: Failed to establish a new connection: [Errno -3] Try again During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/usr/local/lib/python3.7/site-packages/requests/adapters.py", line 449, in send timeout=timeout File "/usr/local/lib/python3.7/site-packages/urllib3/connectionpool.py", line 725, in urlopen method, url, error=e, _pool=self, _stacktrace=sys.exc_info()[2] File "/usr/local/lib/python3.7/site-packages/urllib3/util/retry.py", line 439, in increment raise MaxRetryError(_pool, url, error or ResponseError(cause)) urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='aic-service.lgthinq.com', port=46030): Max retries exceeded with url: /v1/service/application/dashboard (Caused by NewConnectionError('<urllib3.connection.HTTPSConnection object at 0x7fe3e16e4bd0>: Failed to establish a new connection: [Errno -3] Try again')) During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 279, in async_update_ha_state await self.async_device_update() File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 476, in async_device_update await self.hass.async_add_executor_job(self.update) File "/usr/local/lib/python3.7/concurrent/futures/thread.py", line 57, in run result = self.fn(*self.args, **self.kwargs) File "/config/custom_components/smartthinq_washer/__init__.py", line 335, in update raise ex File "/config/custom_components/smartthinq_washer/__init__.py", line 321, in update state = self._device.poll() File "/config/custom_components/smartthinq_washer/wideq/washer.py", line 29, in poll res = self.device_poll("washerDryer") File "/config/custom_components/smartthinq_washer/wideq/device.py", line 651, in device_poll self._client.refresh_devices() File "/config/custom_components/smartthinq_washer/wideq/core_v2.py", line 605, in refresh_devices self._load_devices(True) File "/config/custom_components/smartthinq_washer/wideq/core_v2.py", line 560, in _load_devices self._devices = self._session.get_devices() File "/config/custom_components/smartthinq_washer/wideq/core_v2.py", line 421, in get_devices devices = self.get2("service/application/dashboard").get("item", []) File "/config/custom_components/smartthinq_washer/wideq/core_v2.py", line 413, in get2 language=self.auth.gateway.language, File "/config/custom_components/smartthinq_washer/wideq/core_v2.py", line 133, in thinq2_get timeout=DEFAULT_TIMEOUT, File "/usr/local/lib/python3.7/site-packages/requests/api.py", line 76, in get return request('get', url, params=params, **kwargs) File "/usr/local/lib/python3.7/site-packages/requests/api.py", line 61, in request return session.request(method=method, url=url, **kwargs) File "/usr/local/lib/python3.7/site-packages/requests/sessions.py", line 530, in request resp = self.send(prep, **send_kwargs) File "/usr/local/lib/python3.7/site-packages/requests/sessions.py", line 643, in send r = adapter.send(request, **kwargs) File "/usr/local/lib/python3.7/site-packages/requests/adapters.py", line 516, in send raise ConnectionError(e, request=request) requests.exceptions.ConnectionError: HTTPSConnectionPool(host='aic-service.lgthinq.com', port=46030): Max retries exceeded with url: /v1/service/application/dashboard (Caused by NewConnectionError('<urllib3.connection.HTTPSConnection object at 0x7fe3e16e4bd0>: Failed to establish a new connection: [Errno -3] Try again'))

not all devices are presented in HA

Hi ollo69,

First of all, thank you! this is awesome!

I've installed the SmartThinQ LGE Sensors from HACS. Followed all the instructions and it worked! Particularly 🤔. Although I have 3 devices connected to my ThinQ app (dishwasher, range and fridge), I can see only one in HA (fridge). Any advice?
image
image

New warnings in HA 0.109.0b0

As the title says, HA is making some changes in 0.109 and so far I have seen these two warnings.

2020-04-22 15:40:33 WARNING (MainThread) [homeassistant.helpers.translation] smartthinq_sensors: the '.translations' directory has been moved, the new name is 'translations', starting with Home Assistant 0.111 your translations will no longer load if you do not move/rename this 
2020-04-22 15:37:53 WARNING (MainThread) [homeassistant.util.async_] Detected I/O inside the event loop. This is causing stability issues. Please report issue to the custom component author for smartthinq_sensors doing I/O at custom_components/smartthinq_sensors/wideq/device.py, line 234: return requests.get(info_url, timeout=DEFAULT_TIMEOUT).json()

Washer Remote Start

It would be really great if this integration was not only a sensor, but could also support washer remote start function.

I would like to trigger remote start of a loaded washer in standby mode by using geolocation and automation when I or the other half are heading back in the direction of home, such as traveling back from the office etc.

LG Refrigerator is not displaying fridge temperature

image

model: 1REB1GLPX1___-BF
mac_address: '#####'
refrigerator_temp: '-'
freezer_temp: '-17'
temp_unit: °C
door_open_state: 'off'
smart_saving_mode: Smart Saving Not Used
smart_saving_state: '-'
eco_friendly_state: 'Off'
ice_plus_state: 'Off'
fresh_air_filter_state: unknown
water_filter_used_month: '255'
friendly_name: Refrigerator
icon: 'mdi:fridge-outline'

The refrigerator_temp is not displayed at all, and i think the smart_saving_state is alos not diplayed properly. I can help test if needed.

Remember tubclean count (feature request)

This is just a small tweak, the tubclean count shows N/A after turning off the washer for a while. I think it would make more sense to maintain the counter and update it as the number changes.

Thanks for all the updates, "patiently" waiting for the dryer release that you are working on.

Error 0110 Connection not available. SmartThinQ platform not ready.

This was working on my system but now it is getting an error 0110 and the integration keeps restarting...

2020-05-01 09:19:33 INFO (MainThread) [custom_components.smartthinq_sensors] 
-------------------------------------------------------------------
smartthinq_sensors
Version: 0.3.9
This is a custom component
If you have any issues with this you need to open an issue here:
https://github.com/ollo69/ha-smartthinq-sensors/issues
-------------------------------------------------------------------
2020-05-01 09:19:33 INFO (MainThread) [custom_components.smartthinq_sensors] Initializing SmartThinQ platform with region: CA - language: en-US
2020-05-01 09:19:33 DEBUG (SyncWorker_4) [custom_components.smartthinq_sensors.wideq.core_v2] thinq2_get before: https://route.lgthinq.com:46030/v1/service/application/gateway-uri
2020-05-01 09:19:34 DEBUG (SyncWorker_4) [custom_components.smartthinq_sensors.wideq.core_v2] thinq2_get after: {'resultCode': '0000', 'result': {'countryCode': 'CA', 'languageCode': 'en-CA', 'thinq1Uri': 'https://aic.lgthinq.com:46030/api', 'thinq2Uri': 'https://aic-service.lgthinq.com:46030/v1', 'empUri': 'https://ca.m.lgaccount.com', 'empSpxUri': 'https://ca.m.lgaccount.com/spx', 'rtiUri': 'aic.lgthinq.com:47878', 'mediaUri': 'aic-media.lgthinq.com:47800', 'appLatestVer': '3.0.2100001', 'appUpdateYn': 'N', 'appLink': 'market://details?id=com.lgeha.nuts', 'uuidLoginYn': 'N', 'lineLoginYn': 'N', 'lineChannelId': '', 'cicTel': '1-888-542-2623', 'cicUri': '', 'isSupportVideoYn': 'N', 'countryLangDescription': 'Canada/English', 'googleAssistantUri': 'https://assistant.google.com/services/invoke/uid/000000d26892b8a3', 'smartWorldUri': '', 'racUri': 'ca.rac.lgeapi.com', 'cssUri': 'https://aic-common.lgthinq.com', 'cssWebUri': 'http://s3-an2-op-t20-css-web-resource.s3-website.ap-northeast-2.amazonaws.com', 'iotssUri': 'https://kic-iotservice.lgthinq.com', 'amazonDrsYn': 'N', 'features': {'amazonDrs': 'N', 'disableWeatherCard': 'N', 'thinqCss': 'N', 'cicSupport': 'Y'}, 'serviceCards': []}}

2020-05-01 09:19:34 DEBUG (SyncWorker_4) [custom_components.smartthinq_sensors.wideq.core_v2] {'access_token': '1339eaa9e18ae357f05f6a78c9129f1e9818dafe4cfc9dd846ccd364494af3e63aabde2c800cd11adab500cb1bdc3690', 'expires_in': '3600'}
2020-05-01 09:19:34 DEBUG (SyncWorker_4) [custom_components.smartthinq_sensors.wideq.core_v2] thinq2_get before: https://aic-service.lgthinq.com:46030/v1/service/application/dashboard

2020-05-01 09:19:35 DEBUG (SyncWorker_4) [custom_components.smartthinq_sensors.wideq.core_v2] thinq2_get after: {'resultCode': '0110', 'result': ''}
2020-05-01 09:19:35 ERROR (SyncWorker_4) [custom_components.smartthinq_sensors] ('0110', 'error')
2020-05-01 09:19:35 WARNING (MainThread) [custom_components.smartthinq_sensors] Connection not available. SmartThinQ platform not ready.
2020-05-01 09:19:35 WARNING (MainThread) [homeassistant.config_entries] Config entry for smartthinq_sensors not ready yet. Retrying in 5 seconds.

This repeats every 60 seconds.

Washing Machine missing other State

Hi ollo69,
First of all, this is awsome, you are awsome!
I have recovered the json of my LG washer dryer (F4J8FH2W) and I realized that the DEMO status also exists.
Both in State and in Prestate.
This is the string: "16":"@WM_STATE_DEMO_W"

Also missing some WASHING SPIN SPEED:
"3":"@WM_TITAN2_OPTION_SPIN_600_W",
"4":"@WM_TITAN2_OPTION_SPIN_700_W",
"8":"@WM_TITAN2_OPTION_SPIN_1100_W",
"11":"@WM_TITAN2_OPTION_SPIN_1600_W",
"255":"@WM_TITAN2_OPTION_SPIN_MAX_W".

Also missing WASHING TEMP:
"5":"@WM_TITAN2_OPTION_TEMP_50_W".

I also add Dry State:
"DryLevel":{
"type":"Enum",
"default":"0",
"label":"@WM_TITAN2_OPTION_DRY_W",
"option":{
"0":"-",
"1":"-",
"2":"@WM_TITAN2_OPTION_DRY_NORMAL_W",
"3":"@WM_TITAN2_OPTION_DRY_30_W",
"4":"@WM_TITAN2_OPTION_DRY_60_W",
"5":"@WM_TITAN2_OPTION_DRY_90_W",
"6":"@WM_TITAN2_OPTION_DRY_120_W",
"7":"@WM_TITAN2_OPTION_DRY_150_W",
"8":"@WM_TITAN2_OPTION_DRY_ECO_W",
"9":"@WM_TITAN2_OPTION_DRY_VERY_W",
"10":"@WM_TITAN2_OPTION_DRY_IRON_W",
"11":"@WM_TITAN2_OPTION_DRY_LOW_W",
"12":"@WM_TITAN2_OPTION_DRY_ENERGY_W",
"13":"@WM_TITAN2_OPTION_DRY_SPEED_W",
"14":"@WM_TITAN2_OPTION_DRY_COOLING_W"
}

I'd like to know if it would be possible to set up custom programs with the API.

I hope I was helpful

Can't delete old LGE WASHERS integration

Hi, I was able to set up my washer with the new sensor integration, but the last integration remain and I can't delete it using the basket icon on the integration section. I don't have nothing set up on configuration.yaml Already reboot, try again to delete but nothing, still the notification regarding the old integration. HA 0.108.6 on rasp 3b+ Any clue?

image
image
image

Notification upon load completion

Anyone have an example YAML or Node-Red of how you're detecting when the load is complete? I'd like to send a notification over my Alexa devices.

LG Dryer

Is there a way to add also a LG Dryer?

Washer current state

Hi,
If I'm right, in a washer, the run state is what the washer is doing now and pre state is the previous state?

Right now I see on on run state "detecting" and on pre state "drying" (it's a washer/dryer), but the washer is drying. Seems that they are in the wrong order.

image

Thanks
Pablo

How to use the binary_sensor.lavatrice_wash_completed

Hi,
I have an automation in my setup that listen for changes of the binary_sensor.lavatrice_wash_completed, but seems this never happens.
Also in history, the state is never changed.
The automation works, if i trigger manually the action is fired.
Can you tell me how to catch the washing complete event correctly?
Thanks

Unknown Washer Status

This isn't breaking my functionality, just shows up in the Developer Log window so thought I'd bring it to your attention. I have the WVC9-1410W washer dryer combo which is relatively new.

Log Details (WARNING)
Logger: custom_components.smartthinq_sensors.wideq.device
Source: custom_components/smartthinq_sensors/wideq/device.py:819
Integration: SmartThinQ LGE Sensors (documentation)
First occurred: 7:05:39 PM (1 occurrences)
Last logged: 7:05:39 PM

ThinQ: received unknown WASHER status '@WM_TERM_NO_SELECT_W' of type 'SpinSpeed'

[BUG] Authorization Error

Describe the bug
Trying to get the redirection url I am presented with the login options, from where I choose google account login as I always do.

First thing odd is that sync in Chrome is immediately paused, and I'm invited to authenticate on my Google account once again.

Then authorization via Google credentials redirect url fail with "Error 400: redirect_uri_mismatch".

Visiting the Google's suggested url I get the message that I'm not authorized to view the requested page...

Screenshots
If applicable, add screenshots to help explain your problem.
image

image

Environment details:

  • Environment (HASSIO, Raspbian, etc): HA supervised
  • Home Assistant version installed: 0.111.4
  • Component version installed: 0.5.2
  • Last know working version:
  • LG device type and model with issue: washing machine F4J8JS2W
  • LG devices connected (list): just the F4J8JS2W

Output of HA logs
Paste the relavant output of the HA log here.


Additional context
Add any other context about the problem here.

Additional attribute: remain_time_in_minutes

Hello,

is it possible to add an attribute: remain_time_in_minutes? I need this value for the lovelace ui for the custom:circle-sensor-card. And it would be easier for calculations in automations.

THX

[Feature Request] More Languages to Translate

Dear ollo69,

This custom integration is awesome and it may be even greater if we all help in having more languages available.

Therefore, it would be great if you could share how we can translate it and what do you need from us in order to get it working with more languages.

I'm willing to translate it to Spanish ;)

Thank you!

Fridge/Freezer Temps Incorrect

First, it's great to have your work on this integration!

I've noticed for my LG Fridge that the fridge and freezer temps both report as 9 degrees (should be 4 and -18). I tried turning on my LG Dishwasher out of curiosity but that appears to not be supported yet.

In addition to the debut log I can email to you, I did note the following (possibly unrelated translation) errors:

2020-04-26 11:04:20 ERROR (SyncWorker_14) [homeassistant.util.json] JSON file reading failed: /config/custom_components/smartthinq_sensors/.translations/sensor.en.json
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/util/json.py", line 30, in load_json
with open(filename, encoding="utf-8") as fdesc:
NotADirectoryError: [Errno 20] Not a directory: '/config/custom_components/smartthinq_sensors/.translations/sensor.en.json'
2020-04-26 11:04:20 ERROR (MainThread) [homeassistant.components.websocket_api.http.connection.140320224258064] Error handling message: Unknown error
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/util/json.py", line 30, in load_json
with open(filename, encoding="utf-8") as fdesc:
NotADirectoryError: [Errno 20] Not a directory: '/config/custom_components/smartthinq_sensors/.translations/sensor.en.json'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/components/websocket_api/decorators.py", line 20, in _handle_async_response
await func(hass, connection, msg)
File "/usr/src/homeassistant/homeassistant/components/frontend/init.py", line 549, in websocket_get_translations
resources = await async_get_translations(hass, msg["language"])
File "/usr/src/homeassistant/homeassistant/helpers/translation.py", line 152, in async_get_translations
resources = await async_get_component_resources(hass, language)
File "/usr/src/homeassistant/homeassistant/helpers/translation.py", line 135, in async_get_component_resources
loaded_translations = await load_translations_job
File "/usr/local/lib/python3.7/concurrent/futures/thread.py", line 57, in run
result = self.fn(*self.args, **self.kwargs)
File "/usr/src/homeassistant/homeassistant/helpers/translation.py", line 74, in load_translations_files
loaded_json = load_json(translation_file)
File "/usr/src/homeassistant/homeassistant/util/json.py", line 40, in load_json
raise HomeAssistantError(error)
homeassistant.exceptions.HomeAssistantError: [Errno 20] Not a directory: '/config/custom_components/smartthinq_sensors/.translations/sensor.en.json'
2020-04-26 11:04:20 ERROR (SyncWorker_0) [homeassistant.util.json] JSON file reading failed: /config/custom_components/smartthinq_sensors/.translations/sensor.en.json
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/util/json.py", line 30, in load_json
with open(filename, encoding="utf-8") as fdesc:
NotADirectoryError: [Errno 20] Not a directory: '/config/custom_components/smartthinq_sensors/.translations/sensor.en.json'
2020-04-26 11:04:20 ERROR (MainThread) [homeassistant.components.websocket_api.http.connection.140320213398672] Error handling message: Unknown error
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/util/json.py", line 30, in load_json
with open(filename, encoding="utf-8") as fdesc:
NotADirectoryError: [Errno 20] Not a directory: '/config/custom_components/smartthinq_sensors/.translations/sensor.en.json'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/components/websocket_api/decorators.py", line 20, in _handle_async_response
await func(hass, connection, msg)
File "/usr/src/homeassistant/homeassistant/components/frontend/init.py", line 549, in websocket_get_translations
resources = await async_get_translations(hass, msg["language"])
File "/usr/src/homeassistant/homeassistant/helpers/translation.py", line 152, in async_get_translations
resources = await async_get_component_resources(hass, language)
File "/usr/src/homeassistant/homeassistant/helpers/translation.py", line 135, in async_get_component_resources
loaded_translations = await load_translations_job
File "/usr/local/lib/python3.7/concurrent/futures/thread.py", line 57, in run
result = self.fn(*self.args, **self.kwargs)
File "/usr/src/homeassistant/homeassistant/helpers/translation.py", line 74, in load_translations_files
loaded_json = load_json(translation_file)
File "/usr/src/homeassistant/homeassistant/util/json.py", line 40, in load_json
raise HomeAssistantError(error)
homeassistant.exceptions.HomeAssistantError: [Errno 20] Not a directory: '/config/custom_components/smartthinq_sensors/.translations/sensor.en.json'

Does this component work with TVs?

Is your feature request related to a problem? Please describe.
I couldn't get my TV detected on my LG account

Describe the solution you'd like
I would like to have it detected. Its a LG B9

Describe alternatives you've considered
Tried reconnecting device, different countries.

Error while setting up smartthinq_washer platform for sensor

Using integrations, I created a new one and entered the default values for country (US) and locale en-US and provided my access token. It created the integration w/o any issues but no devices were added. Here is the error from my logs:

Logger: homeassistant.components.sensor
Source: custom_components/smartthinq_washer/wideq.py:826
Integration: Sensor (documentation, issues)
First occurred: 8:21:38 PM (1 occurrences)
Last logged: 8:21:38 PM

Error while setting up smartthinq_washer platform for sensor

ValueError: 202 is not a valid DeviceType

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 179, in _async_setup_platform
    await asyncio.wait_for(asyncio.shield(task), SLOW_SETUP_MAX_WAIT)
  File "/usr/local/lib/python3.7/asyncio/tasks.py", line 442, in wait_for
    return fut.result()
  File "/config/custom_components/smartthinq_washer/sensor.py", line 462, in async_setup_entry
    if device.type == DeviceType.WASHER:
  File "/config/custom_components/smartthinq_washer/wideq.py", line 826, in type
    return DeviceType(self.data['deviceType'])
  File "/usr/local/lib/python3.7/enum.py", line 310, in __call__
    return cls.__new__(cls, value)
  File "/usr/local/lib/python3.7/enum.py", line 564, in __new__
    raise exc
  File "/usr/local/lib/python3.7/enum.py", line 548, in __new__
    result = cls._missing_(value)
  File "/usr/local/lib/python3.7/enum.py", line 577, in _missing_
    raise ValueError("%r is not a valid %s" % (value, cls.__name__))
ValueError: 202 is not a valid DeviceType

This was on HA 0.107.6

Washing machine timer

Hi ollo69,

First of all, this is awsome, you are awsome!

I was just woundering as you are the expert, is it easy to make a countdown timer of % progress bar for a wash that is running?

Like the "initial_time" - "remain_time" = % done or a timer?
Now I only have the binary sensor which is also handy but a timer would be even more awsome.

I have seen a few solutions but I think you would probably have a better solution :)

Dryer beta testing

I got this error with v0.2.1

Logger: homeassistant.core
Source: custom_components/smartthinq_washer/sensor.py:447 
First occurred: 12:03:38 PM (3 occurrences) 
Last logged: 12:04:37 PM

Error doing job: Task exception was never retrieved
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 552, in _update_entity_states
    await asyncio.gather(*tasks)
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 284, in async_update_ha_state
    self._async_write_ha_state()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 328, in _async_write_ha_state
    attr.update(self.device_state_attributes or {})
  File "/config/custom_components/smartthinq_washer/sensor.py", line 382, in device_state_attributes
    ATTR_RESERVE_TIME: self._reserve_time,
  File "/config/custom_components/smartthinq_washer/sensor.py", line 447, in _reserve_time
    if int(reserve_min) < 10:
TypeError: int() argument must be a string, a bytes-like object or a number, not 'NoneType'

Error Loading on 0.4.2

Seem to have a problem running on 0.4.2, 0.4.1 works flawlessly. Looks to error out attempting to load the devices. Worth noting that both my Refrigerator and Dishwasher are only Tap-On devices, so while they are attached to my LG account they don't actually report back data over Wi-fi, they still get loaded though.

2020-05-05 12:49:56 INFO (MainThread) [custom_components.smartthinq_sensors] SmartThinQ client connected.
2020-05-05 12:49:56 INFO (MainThread) [custom_components.smartthinq_sensors] Starting LGE ThinQ devices...
2020-05-05 12:49:56 INFO (SyncWorker_38) [custom_components.smartthinq_sensors.wideq.core_v2] Loading model info for REFRIGERATOR. Model: Normal-101, Url: https://aic.lgthinq.com:46030/api/webContents/modelJSON?modelName=Normal-101&countryCode=WW&contentsId=JS0314074028491784&authKey=thinq
2020-05-05 12:49:57 ERROR (MainThread) [homeassistant.config_entries] Error setting up entry LGE Devices for smartthinq_sensors
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/config_entries.py", line 216, in async_setup
    hass, self
  File "/config/custom_components/smartthinq_sensors/__init__.py", line 163, in async_setup_entry
    lge_devices = await lge_devices_setup(hass, client)
  File "/config/custom_components/smartthinq_sensors/__init__.py", line 398, in lge_devices_setup
    await hass.async_add_executor_job(dev.init_device)
  File "/usr/local/lib/python3.7/concurrent/futures/thread.py", line 57, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/config/custom_components/smartthinq_sensors/__init__.py", line 280, in init_device
    self._model = f"{self._model}-{self._device.model_info.model_type}"
AttributeError: 'NoneType' object has no attribute 'model_type'

Problem with upgrade on new version

Hi,

I have problem with upgrade from 0.3.8 to 0.4.6. After upgrade, next step is restart HA, after start HA I have version 0.3.8.

Where is problem? In log not show error with upgrade...

Thanks

Gui Titles missing

Hi there Ollo69,

First of all thanks to your work! 3x coffees for you :)

Got i working with the previous version today, setup through HA Gui was quiet simple. Upgraded to todays latest release 0.3.6 and something messed it up.
Reinstalled it via HACS, and now if i want to add the integration the popup do not show Titles anymore.

image

Not sure what i am doing wrong :(

br
mole

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.