@subzero79
Without any sucess.
Traceback (most recent call last):
File "/usr/local/lib/python3.6/site-packages/homeassistant/setup.py", line 148, in _async_setup_component
component.setup, hass, processed_config) # type: ignore
File "/usr/local/lib/python3.6/concurrent/futures/thread.py", line 56, in run
result = self.fn(*self.args, **self.kwargs)
File "/config/custom_components/smartthinq/__init__.py", line 39, in setup
client = wideq.Client.from_token(refresh_token)
File "/config/deps/lib/python3.6/site-packages/wideq.py", line 843, in from_token
client._auth = Auth(client.gateway, None, refresh_token)
File "/config/deps/lib/python3.6/site-packages/wideq.py", line 742, in gateway
self._gateway = Gateway.discover()
File "/config/deps/lib/python3.6/site-packages/wideq.py", line 513, in discover
gw = gateway_info()
File "/config/deps/lib/python3.6/site-packages/wideq.py", line 417, in gateway_info
{'countryCode': COUNTRY, 'langCode': LANGUAGE},
File "/config/deps/lib/python3.6/site-packages/wideq.py", line 387, in lgedm_post
with open('/home/ricardo/Documents/develop/homeassistant/wideq.txt','a', encoding="utf-8") as dumpfile:
FileNotFoundError: [Errno 2] No such file or directory: '/home/ricardo/Documents/develop/homeassistant/wideq.txt'
Update: After edit your file Wideq.py , all options appear ! I will test better and will give a feedback.
From
res = requests.post(url, json={DATA_ROOT: data}, headers=headers)
with open('/home/ricardo/Documents/develop/homeassistant/wideq.txt','a', encoding="utf-8") as dumpfile:
json.dump(data, dumpfile, ensure_ascii=False, indent="\t")
out = res.json()[DATA_ROOT]
with open('/home/ricardo/Documents/develop/homeassistant/wideq_out.txt','a', encoding="utf-8") as dumpfile:
json.dump(out, dumpfile, ensure_ascii=False, indent="\t")
To
res = requests.post(url, json={DATA_ROOT: data}, headers=headers)
out = res.json()[DATA_ROOT]
by the way the attribute instant power_state are the power consumption? Only reported zero consumption “instant_power_state: 0”