Add Support for Smart Life Components

Does this now work with bulbs too?

Ta
Scott

Hi Scott
Do you see IFTT in available services in Smartlife app. Some people in Amazon complain that it does not work. Not all devices made to work with smartlife app IFTT support. I have two bulbs like that I cannot do IFTT. I use IFTT with my sonoff plugs that work with eWlink app and they all IFTT compatible

X64 method:
Thanks. Not working for me. I have an account but once I put the email and password and the program not responding and closing for me many times. Once I managed to put SSID and password but that time program vanished without trace after that.

I also tried running commands in Ubuntu 18.4 and 3rd run failed
Run wget https://raw.githubusercontent.com/sean6541/file/master/tuyasetup.py
Run python -m pip install tuyaapi
Run python tuyasetup.py
"sanjeewasam@X220-Tablet:~$ python tuyasetup.py
This script will assist you in setting up your Tuya device for use
with tuyaapi. You must have an active internet connection and a
working WiFi card on the device running this script. If these
requirements are met, press enter to continue…
Traceback (most recent call last):
File “tuyasetup.py”, line 3, in
input(‘This script will assist you in setting up your Tuya device
for use with tuyaapi. You must have an active internet connection and
a working WiFi card on the device running this script. If these
requirements are met, press enter to continue…’)
File “”, line 0

^

SyntaxError: unexpected EOF while parsing"

Tried in Windows machine instructions and the last step fail again see screenshot
-Download https://raw.githubusercontent.com/sean6541/file/master/tuyasetup.py
-Open a cmd window and cd to the directory containing the file you just downloaded
-Run python -m pip install tuyaapi

  • Run python tuyasetup.py and follow the prompts

Hi,

no they don’t work with ifttt, I was hoping they would work with this but i’m assuming not.

I have a few sonoff devices and even a non sonoff wall switch which are all flashed with tasmota, so I could control them with MQTT, is the ewe link cloud service still flakey?

ta
Scott

Ewlink cloud service is OK for me. However I am planning to flash Tasmota too and just waiting for 3 more units with power monitoring. Have 3 plugs at the moment. Only thing is GH control will be lost but if required could be enabled via HA to GH

Probably will have to get rid of the two Smartlife bulbs though they work with GH well. I have 9 hues (3 colour and 6 whites) and just stick with them or get one Xiomi colour that is reasonably priced. That also not all models are compatible.

Hi,

i’ve used the windows app to get it working, now the switch in HA just have 1 seconds of taking my curtain down and than it seems that there is an error. anyone knows what could be the reason ? see the log i got:
Update for switch.switch_1 fails
Traceback (most recent call last):
File “/usr/lib/python3.6/site-packages/urllib3/connection.py”, line 141, in _new_conn
(self.host, self.port), self.timeout, **extra_kw)
File “/usr/lib/python3.6/site-packages/urllib3/util/connection.py”, line 60, in create_connection
for res in socket.getaddrinfo(host, port, family, socket.SOCK_STREAM):
File “/usr/lib/python3.6/socket.py”, line 745, 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/lib/python3.6/site-packages/urllib3/connectionpool.py”, line 601, in urlopen
chunked=chunked)
File “/usr/lib/python3.6/site-packages/urllib3/connectionpool.py”, line 346, in _make_request
self._validate_conn(conn)
File “/usr/lib/python3.6/site-packages/urllib3/connectionpool.py”, line 850, in _validate_conn
conn.connect()
File “/usr/lib/python3.6/site-packages/urllib3/connection.py”, line 284, in connect
conn = self._new_conn()
File “/usr/lib/python3.6/site-packages/urllib3/connection.py”, line 150, in _new_conn
self, “Failed to establish a new connection: %s” % e)
urllib3.exceptions.NewConnectionError: <urllib3.connection.VerifiedHTTPSConnection object at 0x70732bb0>: 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/lib/python3.6/site-packages/requests/adapters.py”, line 440, in send
timeout=timeout
File “/usr/lib/python3.6/site-packages/urllib3/connectionpool.py”, line 639, in urlopen
_stacktrace=sys.exc_info()[2])
File “/usr/lib/python3.6/site-packages/urllib3/util/retry.py”, line 388, in increment
raise MaxRetryError(_pool, url, error or ResponseError(cause))
urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host=‘a1.tuyaus.com’, port=443): Max retries exceeded with url: /api.json?a=tuya.m.device.dp.get&clientId=nvusfxamhprcxgcnpd9n&lang=en&os=Linux&sid=az152995E3417917fd4ob7r3e9d7006d05198ac192089f1792e77507&time=1530030221&v=1.0&sign=d9333b2104a2082ddf50b0d4acfa02ae (Caused by NewConnectionError(’<urllib3.connection.VerifiedHTTPSConnection object at 0x70732bb0>: 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/lib/python3.6/site-packages/homeassistant/helpers/entity.py”, line 197, in async_update_ha_state
yield from self.async_device_update()
File “/usr/lib/python3.6/site-packages/homeassistant/helpers/entity.py”, line 320, in async_device_update
yield from self.hass.async_add_job(self.update)
File “/usr/lib/python3.6/concurrent/futures/thread.py”, line 56, in run
result = self.fn(*self.args, **self.kwargs)
File “/config/custom_components/switch/tuyaha.py”, line 89, in update
self._state = self._tdev.getstate(self._swid)
File “/config/deps/lib/python3.6/site-packages/tuyaapi/init.py”, line 155, in getstate
resp = self.tapi.requestapi(cmd, data)
File “/config/deps/lib/python3.6/site-packages/tuyaapi/init.py”, line 53, in requestapi
respr = requests.post(url, data={‘postData’:data})
File “/usr/lib/python3.6/site-packages/requests/api.py”, line 112, in post
return request(‘post’, url, data=data, json=json, **kwargs)
File “/usr/lib/python3.6/site-packages/requests/api.py”, line 58, in request
return session.request(method=method, url=url, **kwargs)
File “/usr/lib/python3.6/site-packages/requests/sessions.py”, line 508, in request
resp = self.send(prep, **send_kwargs)
File “/usr/lib/python3.6/site-packages/requests/sessions.py”, line 618, in send
r = adapter.send(request, **kwargs)
File “/usr/lib/python3.6/site-packages/requests/adapters.py”, line 508, in send
raise ConnectionError(e, request=request)
requests.exceptions.ConnectionError: HTTPSConnectionPool(host=‘a1.tuyaus.com’, port=443): Max retries exceeded with url: /api.json?a=tuya.m.device.dp.get&cli

Hey Sean,

Fantastic work. I have it working on my switches really well and it’s definitely quicker. May I just ask how the bulb support is going? I have bulbs downstairs and I don’t have neutral wires unfortunately and after weeks of pulling my hair out yours is the first which works. IFTTT HAS HUGE DELAYS and yours doesn’t

Hey,

I bought this switch:

It works really nice, but:
I want to use the 2. way of the switch just as a remote wifi button to switch a light on and off (only one light circuit is available in the wall). Therefore I want to use scenes for the 2. way. But scenes are obviously only available for one way of the switch:


Has anyone noticed the same and has a solution for this problem?
Thanks in advance

Jan

1 Like

could be that after registering the same switch with this system but with different names HA recognized both names? like they are registered in my tuya account?

Thanks for the nice work

HA 0.74.0 added Tuya component. Does this mean we can now direcly control Smartlife and Tuya devices in HA?

New Platforms
Added support for Duke Energy smart meters (@w1ll1am23 - #15165) (sensor.duke_energy docs) (new-platform)
Added Push Camera (@dgomes - #15151) (camera.push docs) (new-platform)
Add Cloudflare DNS component. (@ludeeus - #15388) (cloudflare docs) (new-platform)
Add Tuya component and switch support (@huangyupeng - #15399) (tuya docs) (switch.tuya docs) (new-platform)
Add HomematicIP alarm control panel (@mxworm - #15342) (alarm_control_panel docs) (homematicip_cloud docs) (alarm_control_panel.homematicip_cloud docs) (new-platform)
Add Tuya light platform (@huangyupeng - #15444) (tuya docs) (light.tuya docs) (new-platform)

I don’t know, what does the documentation say?

It’ll still be cloud based anyway, who wants that?

Tuya and Smartlife apps work on same items. So I believe smart life items will work with this component. There are some who would still OK with cloud rather than throwing them in the bin. There are times when HA also crash and not working as expected so having HA and App control, Google home voice control for same item is kind of OK.

I am unable to check it for now as I have removed my bulbs and using Hue lights only for I could not get Smartlife bulbs working for me with HA. So just checking if anyone had tried it before I spend more hours on this

1 Like

The answer is YES …you can now use Smart Life devices with 0.74.x +. You need to use the Tuya app on your smart phone to add the device, then use HA to import the devices. Should discover automatically once you add the devices to the Tuya app

I have 3 Covers with devices compatible with Tuya / Smart Devices
Can you make it work with new component?

Does the power monitoring work on the power monitor plugs?

I have only worked with the bulbs so I can:t answer this, but if you already have the plug, you should give it a go.

just purchased some sockets and the on and off worked straight off.
But no monitoring available yet, where would i look to try and work out the monitoring?
(Smart Life android app has monitoring working fine)

another vote for Smart Life

Already added by way of the Tuya component.

Yes sorry. i realized too late… had voted already :slight_smile: and waiting for my raspberry to arrive to install Home Assistant…