Homey Community Forum

[APP]TuyAPI / Neo Coolcam wall plug WIFI app

Since there was no app for the WIFI NEO COOLCAM plugs ive put one together for myself based on the TUYAPI by codetheweb. Because i saw some app requests for these plugs i’ve supmitted it to the appstore aswell. I Realize that this is not something for everyone since getting the ID and Keys for the devices is takes some doing and the API is community work to but if you don’t like IFTTT like me this might be a option for you.

afbeelding

Git: https://github.com/rebtor/nl.rebtor.tuya/
Store: https://apps.athom.com/app/nl.rebtor.tuya (awaiting approvel of athom)

Tuya devices homey app

A implementation of TuyAPI for use with homey.

CHANGELOG

  • 1.0.0
    • Initial version with support for NEO Coolcam smartplug 2000W

Basic Usage

See the setup instructions for how to find the needed parameters.

Once these parameters (ID and Key) are known you can use this information to create a device in homey to communicate with the Tuya cloud network without the use of IFTT.

Warning: This app is not plug and play finding the ID and Key needed tot communicate with the tuya cloud takes some doing.

:memo: Notes

  • Only one TCP connection can be in use with a device at once. If using this, do not have the app on your phone open.
  • Some devices ship with older firmware that may not work with tuyapi . If you’re experiencing issues, please try updating the device’s firmware in the official app.
  • I think other smartplugs from tuya may work to with this app. The 3600 watt version from NEO Coolcam is on its way from China.

DEVICES

  • NEO Coolcam 2000 watt smartplug
9 Likes

Hey Rens.

Great work, I think a lot of people like this.

I am wondering, are you planning to add more Neo Coolcam wifi devices? (Like the motion/door sensor).

Bought the wifi devices by mistake. :wink:

1 Like

What kind do you have?

I’m planning on adding the 3600 watt plug when i get that from china.

I use zwave an zigbee sensors myself and i don’t realy like wifi devices myself. These plugs are just so cheap that it makes it worth while. But why buy a 12 dollar wifi sensor if a 9 dollar zigbee does the same job…

To be honest I prefer zigbee/z-wave as well.
But I bought them by accident, didnt want to throw them in the bin so have them working now with IFTTT and it got a huge delay.

I am planning to replace them with wifi devices, but then I saw this post and thought ‘lets ask’. :wink:

I am talking about the wifi neo coolcam doorsensor and motion sensors.

What you can do is install this app and add them as powerplugs. Big chance that if you trigger the sensor the plug in homey turns on and off. If that is the case i will add an sensor device aswell. I might even order a door sensor from china but that takes a couple of weeks before they are here.

I have checked it. The battery powered devices cant be controlled by the tuyapi libery. So that won’t work

Hi Rens!

I have followed the instructions to the point, but in the console the text “waiting for request…” remains.
When I refresh the app Smart Life app its says “network is unavailable”.

Capture

Any ideas.

I should add that this is the first time I am doing anything like this. But I have managed to do everything in the list you have provided here: https://github.com/codetheweb/tuyapi/blob/master/docs/SETUP.md

BR
Harryd

Hi Harryd,

I know this list is a bit messy. Wish they would just put the key in the smartlife app that would be so much easyer.

I’m not to sure how it works exacly on iphone because i used my android phone. But be sure to install the cetificate ( by scanning the QR code . And don’t forget to remove it when your done) and setup the proxy to the ip and port.

Also make sure your firewall on your pc is not blocking the requests from your phone. Mine did that (i use ESET and it blocks almost any port except the ports for mail and web).

Good luck.

Hi!

Might add that I am running this on a Windows 10 computer. I also came to think of the firewall. But even with the FW completely turned off I still get the same results.

On the iPhone/iPad the certificate is trusted and the proxy settings have been added.

Really strange. Can’t think of something else that would block the connection.

//Harryd

Hi Again!

Once more question, this key which I am looking for, how does it look like? How many digits, etc?

BR
Harryd

It comes out something like this:

{ id: ‘24212176ecfabcaXXXXf’, key: 'XXXX5e60d767XXXX },
{ id: ‘XXXX488bcddc29573eb’, key: ‘XXXXb1eXXXXXXXX’ }

Digits and numbers. Key is 16 in length.

Hi!

I initially used Windows 10 and iPhone/iPad. And it didnt work.
Then I remembered that I had an old Android tablet. After one hour of banging my head into the table because of the slowness of the old tablet I finaly managed to install everything…and…it worked! :slight_smile:

Capture

so, it looks like it only works if you use an Android device… Good to know for other people :slight_smile:

//Harryd

Hi

For everyone not doing stuff like this on regular basis…This is how I did it.

This was done on Windows 10 and an Android tablet. With my iOS devices it didn’t work.
Windows defender firewall was activated but I opened port 8001 (not sure if it is necessary).
You can find how to open a port here: https://www.tomshardware.com/news/how-to-open-firewall-ports-in-windows-10,36451.html)

  1. Downloaded Node.js (https://nodejs.org/dist/v10.16.2/node-v10.16.2-x64.msi)
  2. Installed it without any custom settings.
  3. Once installed, I opened up “Node.js command prompt” from the windows start menu and followed Rens instructions.
    3.1 Typed “npm i @tuyapi/cli -g” command prompt and waited for it to complete.
    3.2 Typed “npm i anyproxy -g” in the command prompt and waited for it to complete.
    3.3 Typed “anyproxy-ca” in the command prompt , answered “Y” on the question.
    3.4 Typed “tuya-cli list-app” in the command prompt. This generated a QR code and started the proxy server.
  4. Picked up an Android Device (Didn’t work with my iOS devices) with the Smart Life app on it. and scanned the QR code.
    4.1 Installed the certificate.
    4.2 Updated the WiFi settings on the Android device with the proxy settings provided in the command prompt.
  5. Opened the Smart Life app and the command prompt returned below:
    neo6

(I only had once device, but I imagine if more devices are in the Smart Life app there will be more rows with ID’s and keys.)

Hope it helps!

1 Like

Hey Rens ive managed to add a colour light globe with your app. Little experience in doing this but with the help of harryd as i was on android to managed to add the device. With the device i can change the colour in the Tuya app but when i added the device i selected the plug and inputted the id/key. Its added to only as a plug obviously, this only allows the on/off function (which works) but no colour change or dim function. Is this not possible or did i add it wrong? thanks and great work.

I never did this cmd stuff before. So appoligize for that. I got the whole thing working. My laptop shows the qr code. I installed the certificate on my iphone. But what should i do next? What do you mean by "adjusting my wifi settings on my smartphone?

When i try to visit the ip adres with port number i get this message on my phone and on my laptop

# AnyProxy Inner Error

Oops! Error happend when AnyProxy handle the request.

This is an error occurred inside AnyProxy, not from your target website.

Error:

Error: connect ECONNREFUSED 127.0.0.1:80

Hi!

You should use the IP address and the port number displayed below the QR code and enter them as proxy on your phone.

Here is a guide if you don’t know how to do that.

//Harryd

ok Harry. Thanks for helping. I changed the proxy on my iphone. What is the last step i have to do?
when i open the Tuya app it says: network faillure

Make sure you have opened up port 8001 in your firewall, Norton Internet Security more or less blocks everything. If you don’t have any 3rd party security software you still have Windows Defender which might block the connection.

//Harryd

Have you tried connecting the Action products already?

Packaging of a Action socket
image

Tried a plug but could not add it to the smartphone app. Gonna try again later today and keep u posted.