Page 1 of 1

How to list and control devices from "Smart Life" app: Tasker/Macrodroid plugin

Posted: 2024年 Aug 13日 20:17
by honeyjar

Context: I'm willing to create an automation app which is a plugin for Tasker and Macrodroid automation apps that allows me to control my devices.
Since my devices are all connected to the Smart Life app I need to call APIs/SDK in order to list and receive notifications for them.
I don't want to create a new, separate, application where to register all the devices because my app must be a plugin, to ADD features to Smart Life, not to replace it.

Problem: I've tied creating my app following the tutorials but basically this means I'm creating a separate app and thus my app does not see any of my Smart Life devices :-/

Question: how do I configure my Android app in order to see the devices which are already registered in the smart Life app? I totally understand that I will need ask the user the Smart Life credentials and this is ok

So far I've guessed that perhaps I might try "intercepting" the app_key+secret used by Smart Life but this seems like an hack. Any official ways to do this?

thanks everyone for support!

P.S.: best thing would be that Smart Life for Android exports Tasker actions but unfortunately it does not :-(


Re: How to list and control devices from "Smart Life" app: Tasker/Macrodroid plugin

Posted: 2024年 Aug 14日 17:48
by daxiong

Sorry,we do not currently support exposing Smart Life app device data to developers.


Re: How to list and control devices from "Smart Life" app: Tasker/Macrodroid plugin

Posted: 2024年 Aug 14日 18:29
by honeyjar

thanks @daxiong for the reply.
Is there any way to create a "plugin" app for Smart Life which allows to extend the main app functionalities?


Re: How to list and control devices from "Smart Life" app: Tasker/Macrodroid plugin

Posted: 2024年 Aug 14日 19:28
by daxiong

We will be launching a new version of the Home Assistant plugin, which will allow you to control your smart devices in the Smart Life app through Home Assistant. If you would like to experience the current Tuya Home Assistant plugin's capabilities, you can refer to the following link: https://developer.tuya.com/cn/docs/iot/ ... fbszoffjmw.


Re: How to list and control devices from "Smart Life" app: Tasker/Macrodroid plugin

Posted: 2024年 Aug 15日 01:57
by honeyjar

Many thanks: will totally look into it!


Re: How to list and control devices from "Smart Life" app: Tasker/Macrodroid plugin

Posted: 2024年 Aug 18日 19:44
by honeyjar

I've looked into the documentation but I'm not sure which is the "correct" integration, can you please help me?

I've started from the official documentation here: https://developer.tuya.com/en/docs/iot/ ... fbszoffjmw
which points to this docs: https://developer.tuya.com/en/docs/iot/ ... cjcbvk2mu8
which then point to this official repo "Tuya Home Assistant" : https://github.com/tuya/tuya-home-assistant
which in turn says it's obsolete and points to "Tuya Smart Life": https://github.com/tuya/tuya-smart-life
which then says it's obsolete too (!!!) and it's now part of the "Home Assistant Core"

Does this mean that just by downloading Home Assistant core I get all the integration features?

BTW: I tried downloading "Tuya Smart Life": https://github.com/tuya/tuya-smart-life and it works pretty well, whereas I did not seem to find it inside the Home Assistant core that I installed


Re: How to list and control devices from "Smart Life" app: Tasker/Macrodroid plugin

Posted: 2024年 Aug 20日 16:58
by qiufeng.yu

Hello, if you want to integrate and manage Tuya-related devices in Home Assistant (HA), you can refer to this documentation: https://www.home-assistant.io/integrations/tuya/
Once your HA application has launched successfully, you can enter your Smart Life User Code, the User Code is located in the app's home page -> Me -> Settings (top right corner) -> Account and Security., then scan the QR code to authorize and log in.

e.g:
Image
Image
Image
Image
Image


Re: How to list and control devices from "Smart Life" app: Tasker/Macrodroid plugin

Posted: 2024年 Aug 21日 04:23
by honeyjar

Thanks a lot for your guidance: I succeeded in installing and configuring it!
Is there a specific site with documentation on features?
I'm specifically looking into building an automation which is triggered when a wired camera sees a movement (like what happens when there is alarm received from Smart Life app).
As far as I can see I can trigger a routine when a setting is changed but not when the camera triggers an alarm.
Am I missing anything?

thanks again for your support!


Re: How to list and control devices from "Smart Life" app: Tasker/Macrodroid plugin

Posted: 2024年 Aug 21日 14:37
by qiufeng.yu

The HA system has built-in automation modules, so you can try configuring rules within the automations.
Image

If the automation rules in HA do not meet your needs, you might consider developing your own solution based on the messages and APIs provided by the Tuya Open Platform.
Tuya Open Message
Tuya Open API


Re: How to list and control devices from "Smart Life" app: Tasker/Macrodroid plugin

Posted: 2024年 Aug 22日 03:52
by honeyjar

thanks a lot!
My point is the fact that the HA plugin does not seem to have an event corresponding to the "camera has seen something, ring an alarm"
I'm wondering if the Tuya plugin for HA core is open source and if I can look into it and maybe submit a patch to support also my scenario!