• Stars
    star
    285
  • Rank 145,115 (Top 3 %)
  • Language
    Python
  • License
    MIT License
  • Created almost 7 years ago
  • Updated about 3 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Home Assistant component for LG SmartThinQ HVAC devices

Home Assistant: LG SmartThinQ Component

A Home Assistant component for controlling/monitoring LG devices (currently HVAC & Dishwasher) via their SmartThinQ platform, based on WideQ. The current version of the component requires Home Assistant 0.96 or later.

You can install this component with HACS. Add the "custom repository" sampsyo/hass-smartthinq as an integration.

You can also install it manually:

  1. Clone this repository into your ~/.homeassistant directory under custom_components and name it smartthinq. For example, you might do something like this:

    $ cd ~/.homeassistant
    $ mkdir custom_components
    $ cd custom_components
    $ git clone https://github.com/sampsyo/hass-smartthinq.git smartthinq
    
  2. Navigate to the WideQ directory. You can either use the copy installed by Home Assistant, or clone it separately by typing something like:

    $ git clone https://github.com/sampsyo/wideq.git
    $ cd wideq
    

    Authenticate with the SmartThinQ service to get a refresh token by running the WideQ example script. (Eventually, I would like to add a feature to the Home Assistant component that can let you log in through a UI, but I haven't gotten there yet.) Run this in the wideq directory:

    $ python3 example.py -c US -l en-US
    

    For the -c and -l parameters, use your country and language code: SmartThinQ accounts are associated with a specific locale, so be sure to use the country you originally created your account with. The script will ask you to open a browser, log in, and then paste the URL you're redirected to. It will then write a JSON file called wideq_state.json.

    Look inside this file for a key called "refresh_token" and copy the value.

  3. Add a stanza to your Home Assistant configuration.yaml like this:

    smartthinq:
        token: [YOUR_TOKEN_HERE]
        region: US
        language: en-US
    

    Use your refresh token and country & language codes. If region and language are not provided, then 'US' and 'en-US' are default. Start up Home Assistant and hope for the best.

Dishwasher Visualization Example

Dishwashers will be automatically added as a new sensor.lg_dishwasher.[ID] entity with various useful attributes. See the below example for how this can be used in the Lovelace UI, which uses the built-in picture-elements card, the circle custom card, the entity attributes card and card mod.

Dishwasher Lovelace card

Lovelace configuration is below. Replace [ID] with the entity ID from your dishwasher. Place the dishwasher background image in your Home Assistant local directory.

elements:
  - attribute: remaining_time_in_minutes
    attribute_max: initial_time_in_minutes
    entity: sensor.lg_dishwasher_[ID]
    fill: 'rgba(40, 40, 49, 0.6)'
    font_style:
      font-color: white
      font-size: 2em
      line-height: 1.2
      text-align: center
      text-shadow: 1px 1px black
    gradient: true
    min: 0
    name: Time Left
    show_card: false
    stroke_width: 15
    style:
      align: center
      left: 50%
      top: 30%
      width: 50%
    type: 'custom:circle-sensor-card'
  - entity: sensor.lg_dishwasher_[ID]
    filter:
      include:
        - key: sensor.lg_dishwasher_[ID].state
          name: State
        - key: sensor.lg_dishwasher_[ID].course
          name: Program
        - key: >-
            sensor.lg_dishwasher_[ID].initial_time
          name: Initial Program Length
        - key: >-
            sensor.lg_dishwasher_[ID].remaining_time
          name: Remaining Time
        - key: sensor.lg_dishwasher_[ID].error
          name: Error(s)
    heading_name: Detail
    heading_state: Value
    style:
      left: 50%
      top: 66%
      width: 70%
    type: 'custom:entity-attributes-card'
image: /local/dishwasher_background.png
style: |
  ha-card {
    background-color: rgba(0,0,0,0.6);
  }
type: picture-elements

Credits

This is by Adrian Sampson. The license is MIT.

More Repositories

1

cs6120

advanced compilers
HTML
746
star
2

bril

an educational compiler intermediate representation
Rust
558
star
3

llvm-pass-skeleton

example LLVM pass
C++
550
star
4

wideq

reverse-engineered client for the LG SmartThinQ API
Python
329
star
5

ppl-intro

probabilistic programming for PL folks
Makefile
152
star
6

bluelet

simple asynchronous socket I/O with Python coroutines
Python
110
star
7

quala

custom type systems for Clang
C++
96
star
8

emfed

embed your Mastodon feed into your web page
TypeScript
76
star
9

flatcalc

world's worst interpreter
Rust
48
star
10

hooknook

a little place for your deployments
Python
47
star
11

tinygl

itsy-bitsy OpenGL and GLSL example
C
47
star
12

cluster-workers

a Python client/master/worker system for distributing jobs in a cluster
Python
44
star
13

llvm-ei

extensible interpreter for LLVM dynamic analyses
C++
43
star
14

minisynth

program synthesis is possible
Python
39
star
15

clusterfutures

super-slick Slurm and Condor cluster execution for Python
Python
23
star
16

homebrew-mspgcc

formulae for the MSP430 microcontroller compiler toolchain
Ruby
21
star
17

vegalive

live preview of Vega visualizations
JavaScript
18
star
18

home

my academic site and blog
HTML
18
star
19

bibble

another BibTeX-to-HTML (with Jinja2 templates)
Python
15
star
20

autolink.vim

automatically search for & insert URL targets for links in Markdown & ReST
Vim Script
10
star
21

approxbib

annotated bibliography on approximate computing
TeX
9
star
22

loglet

send log messages to the web
Python
8
star
23

lua-sundown

process Markdown safely and quickly in Lua
C
7
star
24

dq

dead-simple download queue manager
Python
7
star
25

madoko-template

style+Makefile skeleton for writing with Madoko
Makefile
6
star
26

lang-start

skeleton for a language implementation in OCaml
OCaml
5
star
27

jsonshelve

simple, multi-backend key/value persistence for Python
Python
5
star
28

python-blekko

bindings for the Blekko search engine API
Python
5
star
29

docker-rpi-mopidy

Mopidy for Raspberry Pi via Docker
5
star
30

mblite

experimental SQLite database for MusicBrainz
Python
5
star
31

tdot

simple terminal output for GraphViz
Python
5
star
32

bkp1696

control and query the BK Precision 1696 power supply
Python
4
star
33

homebrew-py

Python-related additional packages for Homebrew
Ruby
4
star
34

velocity

simple, fast Notational Velocity for the terminal
Rust
4
star
35

clang-quala

Clang with type annotations
C++
4
star
36

cs3410-infra

public infrastructure for Cornell's CS 3410
Dockerfile
4
star
37

greatisas

The Great ISAs
HTML
3
star
38

execnet-futures

use concurrent.futures on a cluster via execnet
Python
3
star
39

stapler

experimental unstructured static site generator
Python
3
star
40

codegrade

simple autograder tool for running tests on student code
Python
3
star
41

fdpo

Python
2
star
42

campuslack

connect Campuswire to Slack
TypeScript
2
star
43

mruf

farm accounting and ordering system
Python
2
star
44

delete

uncrudify the new ACM Digital Library
JavaScript
2
star
45

ap

adaptive parsing
Python
2
star
46

madmin

replace yourself with a few short shell scripts
Go
2
star
47

thesis

Hardware and Software for Approximate Computing
TeX
2
star
48

enerj

Java
2
star
49

liveserve

flexible command-line LiveReload server
Python
1
star
50

samizdat

just a numerical data converter
Rust
1
star
51

vivado-example

just a minimal tcl setup for running Vivado synthesis on a self-contained design
SystemVerilog
1
star
52

enerj-apps

Java
1
star
53

imbib

cite papers by URL
Python
1
star
54

antisocial

minimal ActivityPub server
Rust
1
star
55

docker-rpi-shairplay

Shairplay on Raspberry Pi via Docker
1
star
56

wh

Python
1
star
57

mute-orb

conjure an orb of silence
Python
1
star
58

need4approval

feeding an unhealthy addiction
Python
1
star
59

rematch

research matching tool
Python
1
star
60

sp110e-mqtt

control SP110E LED devices via MQTT
Python
1
star
61

fake

it's a fake
Rust
1
star