[APP][Pro] TuyAPI / Neo Coolcam wall plug WIFI app

Just submitted version 1.0.7 for review by Athom (normaly takes a couple of days to get accepted).

In this update:
Fix for the filament bulb icon.

and…

I added a little more easy way to identify parameters of a device witch are not supported by the app yet.

First you add the device as a simple on / off device like the Neo Coolcam 2000 plug or the LSC wallplug. Then, change some settings around the smart life app.

If you go to the settings / advanced settings of the homey device in the homey app (or use http://developer.athom.com/tools/devices) you will see a new “setting Data atribute log”. Find the dps () and within the brackets you will find the parameters. (note 1: with most devices only values that are changed are being send / logged Note 2: The log is limited to 1500 characters after the it will be cleared and the log will start over. For devices with many parameters you might need multiple logfiles. Note 3: in the app you need to go back to the devices screen for the device settings / logfile to reload).

advanced%20settings

Data%20atribute%20log

In this example a filament LED with 2 parameters.

1: true / false for on (true) / off (false)
and
2: number between 10 and 255 for dim (minimum brightness 10 to full brightness 255).

If you send me the name of the device and type. The raw log file(s) (you can copy paste) and an explanation to what parameter does (Can in Dutch or English) what and very important the minimum and maximum values are and what the minimum and maximum values stand for.
For example Color temperature goes from cold (blue) 0 to hot (yellow) 1 in the homey app but in the tuya app it goes from hot 0 to cold (255). So i have to change them around.

With this information i should be able to write an app write an app to support the device.

2 Likes

1.0.7 has just been released in the appstore

Hi Rens,

About a month ago I sent you an email about a power socket device that can be switched on and off 4 sockets and 4 USB ports that can be switched on and off.
This week a colleague of mine did some research with a .net library and found out that the dps values to switch are 1, 2, 3, 4, 7.
1 to 4 are the sockets, and 7 are the USB ports.

Could you add this power socket with this information?

Hi,

Sorry, must have overlooked this one. Yes i can. But can you add this device as coolcam 2000 w plug and send me the data file as written in the previous post. (you should be able to switch the first socket in and off with this device)

Thanks, Rens

Thats correct, the first power socket is only working when I add the Coolcam 2000w, if I choose the 3600w version nothing happen. Tomorrow I will have the socket back and I will deliver a log.

Hi Rens,

Hereby the data from the power socket.

DATAATLOG "\n NEW DATA ATRIBUTE: {\"devId\":\"44277377dc4f22fd282c\",\"dps\":{\"1\":false,\"2\":false,\"3\":false,\"4\":false,\"7\":false,\"101\":0,\"102\":0,\"103\":0,\"104\":0,\"105\":0}}\n NEW DATA ATRIBUTE: {\"devId\":\"44277377dc4f22fd282c\",\"dps\":{\"1\":true},\"t\":1570551143,\"s\":6}\n NEW DATA ATRIBUTE: {\"devId\":\"44277377dc4f22fd282c\",\"dps\":{\"1\":false},\"t\":1570551144,\"s\":7}"

Thanks, i have just submitted support for this device to the beta channel of the app i will write a message when it’s approved by Athom. After i get back from you that it works alright i can submit it to the stable channel.

Note, at this moment you should be able to control all individual sockets and turn all sockets on and off at the same time from the app. When one or more sockets is on the main device is on otherwise it is off. (thanks to the limitation that Athom only implemented multinode devices in Zwave) i can’t add a virtual device for every individual node / socket.

Because this is a multi node device i need to do something extra to be able to control and check the status for all the individual sockets from flows. I will try to put this in later when i have a little more time on my hands (I think later this week or in the weekend).

Also if you can find out what the parameters 102 till 105 do i’m all ears.

Hi Rens,

Thanks!
In developer mode I can switch each socket independently.
When I use the button in the app, everything turns on or off except socket 4.

In the flows I can only switch everything on or off (except socket 4), and not individually as in the developer mode, is it possible to add flow cards for this?

It would be nice if Atom would also add the option to add a multi-node device as it can with z-wave.
It would be nice if the sockets could be switched separately via the flow cards.

The only flow cards i have now is “zet aan, zet uit, schakel aan of uit” (switch on, switch off, switch on or off).

edit:
node_modules/tuydriver/index.js

	else if (parameter == 'mulsoc') 
	{
		this.devicelog('All socket switch: ', value);
		return APIdevice.set({
							multiple: true,
							data: 	{
							1: value,
							2: value,
							3: value,
							5: value,  <===== Must be 4
							7: value
							}
		}).catch( err => {console.error(err);});	
	}

Edit 2:

 NEW DATA ATRIBUTE: {"devId":"44277377dc4f22fd282c","dps":{"101":3600},"t":1570573585,"s":119}
 NEW DATA ATRIBUTE: {"devId":"44277377dc4f22fd282c","dps":{"102":7200},"t":1570573590,"s":120}
 NEW DATA ATRIBUTE: {"devId":"44277377dc4f22fd282c","dps":{"103":10800},"t":1570573594,"s":121}
 NEW DATA ATRIBUTE: {"devId":"44277377dc4f22fd282c","dps":{"104":14400},"t":1570573597,"s":122}
 NEW DATA ATRIBUTE: {"devId":"44277377dc4f22fd282c","dps":{"105":18000},"t":1570573601,"s":123}
 NEW DATA ATRIBUTE: {"devId":"44277377dc4f22fd282c","dps":{"101":3570},"t":1570573614,"s":124}
 NEW DATA ATRIBUTE: {"devId":"44277377dc4f22fd282c","dps":{"7":true,"105":0},"t":1570573615,"s":125}
 NEW DATA ATRIBUTE: {"devId":"44277377dc4f22fd282c","dps":{"7":false},"t":1570573616,"s":126}
 NEW DATA ATRIBUTE: {"devId":"44277377dc4f22fd282c","dps":{"102":7170},"t":1570573620,"s":127}

Parameters 101 - 105 are countdown timers.
If I use the Tuya app I can set timers, the parameters 101 to 105 are the countdown timers in seconds. (Max 23h 59m).

Like i wrote i will take a look at the flow charts later. (that can be fixed). I will fix the small bug in all on / off this evening.

Just placed the fix for socket 4 and flowcharts on github. Release request for store is on its way.

Next up homey 3.0.0 release

Hello. Are all Tuya devices supported? https://en.tuya.com

Hi HarryD

At step 4 my phone doesn’t scann the QR-code? It’s a android phone. What I’m a missing? I did shut down Windows defender firewall to be sure it isn’t a firewall issue but no results.

Try and download a QR app from google play.
Open the app and scan the code. I had to do this as well but forgot to mention it in the instructions.

Oké that works, I used a other QR app. That created a IP adres where I downloaded a cap.pem file aka the certificate. I copied the certificate to my Android phone and installed it. I added the proxy IP and port. Opened the app and no ID and key :frowning: what do miss? Do I need to select the certificate on the phone? I didn’t found a option.

Hi!

Have you added the devices to the Tuya Smart Life App? If yes, then try and drag down to refresh the app.
If you haven’t added any devices, you have to do that first.

//Harryd

Hi harryd,

Yes I added the devise to the Tua Smart Life app. When I drag down nothing happens in the console, just ‘Wating for request’.

Have you installed the certificate for use by apps?

No, just the grid powered ones, and those as listed in the app / or simular.

For support for different devices see my post above

Hi!

If you have done
4.1 Installed the certificate.
4.2 Updated the WiFi settings on the Android device with the proxy settings provided in the command prompt.

Then it should work. But it feels like the phone doesnt get connection to the proxy. Double check the settings.

Hi!

Oké I got a little bit futher. When I drag down to refresh th app I get a error. “In correct local timer, please correct it 50502” EDIT: I don’t get that error every time. I tried evertyhing from the beginning and no error. But also no key.

And yes I did installed the certificate en updates the WiFi settings on the Andorid device with the proxy settings.

I added the proxy like this https://youtu.be/oKqMwEP23Ak (with the IP and port from the command prompt)

I added the certificate like this https://support.google.com/nexus/answer/2844832?hl=nl and choice for WiFi

I noticed when I got the certificate link the poort is a other number. Is that a problem?