AMoo-Miki / homebridge-tuya-lan

Homebridge plugin for IoT devices that use Tuya Smart's platform
MIT License
203 stars 51 forks source link

Australian Arlec power plug #114

Open aurorus86 opened 4 years ago

aurorus86 commented 4 years ago

Hi, I'm new to all this. I am having trouble setting up and getting the key to my second Arlec switch. It works on the tuya app. Yes managed to get my first one working, but just bought some more and coming across some errors after following the set up instructions (see below). I had similar problems the first time - but it eventually got the key.

Thanks for you help!

Errors:

pi@raspberrypi:~ $ tuya-lan-find You have multiple network interfaces: 192.168.0.15, 192.168.0.5 Choose one by passing it with the --ip parameter.

Example: tuya-lan-find --ip 192.168.0.15 pi@raspberrypi:~ $ tuya-lan-find --ip 192.168.0.15 . . .

Follow the instructions on https://github.com/AMoo-Miki/homebridge-tuya-lan/wiki/Setup-Instructions Proxy IP: 192.168.0.15 Proxy Port: 8080

Intercepted certificate request Error: EPIPE { Error: write EPIPE at WriteWrap.afterWrite [as oncomplete] (net.js:844:14) errno: 'EPIPE', code: 'EPIPE', syscall: 'write' } Error: EPIPE { Error: write EPIPE at WriteWrap.afterWrite [as oncomplete] (net.js:844:14) errno: 'EPIPE', code: 'EPIPE', syscall: 'write' } Error: EPIPE { Error: write EPIPE at WriteWrap.afterWrite [as oncomplete] (net.js:844:14) errno: 'EPIPE', code: 'EPIPE', syscall: 'write' } Error: EPIPE { Error: write EPIPE at WriteWrap.afterWrite [as oncomplete] (net.js:844:14) errno: 'EPIPE', code: 'EPIPE', syscall: 'write' } Error: EPIPE { Error: write EPIPE at WriteWrap.afterWrite [as oncomplete] (net.js:844:14) errno: 'EPIPE', code: 'EPIPE', syscall: 'write' } Error: EPIPE { Error: write EPIPE at WriteWrap.afterWrite [as oncomplete] (net.js:844:14) errno: 'EPIPE', code: 'EPIPE', syscall: 'write' } Error: EPIPE { Error: write EPIPE at WriteWrap.afterWrite [as oncomplete] (net.js:844:14) errno: 'EPIPE', code: 'EPIPE', syscall: 'write' } Error: EPIPE { Error: write EPIPE at WriteWrap.afterWrite [as oncomplete] (net.js:844:14) errno: 'EPIPE', code: 'EPIPE', syscall: 'write' } Error: EPIPE { Error: write EPIPE at WriteWrap.afterWrite [as oncomplete] (net.js:844:14) errno: 'EPIPE', code: 'EPIPE', syscall: 'write' } Error: EPIPE { Error: write EPIPE at WriteWrap.afterWrite [as oncomplete] (net.js:844:14) errno: 'EPIPE', code: 'EPIPE', syscall: 'write' } Error: EPIPE { Error: write EPIPE at WriteWrap.afterWrite [as oncomplete] (net.js:844:14) errno: 'EPIPE', code: 'EPIPE', syscall: 'write' } Error: EPIPE { Error: write EPIPE at WriteWrap.afterWrite [as oncomplete] (net.js:844:14) errno: 'EPIPE', code: 'EPIPE', syscall: 'write' } Error: EPIPE { Error: write EPIPE at WriteWrap.afterWrite [as oncomplete] (net.js:844:14) errno: 'EPIPE', code: 'EPIPE', syscall: 'write' } Error: EPIPE { Error: write EPIPE at WriteWrap.afterWrite [as oncomplete] (net.js:844:14) errno: 'EPIPE', code: 'EPIPE', syscall: 'write' } Error: EPIPE { Error: write EPIPE at WriteWrap.afterWrite [as oncomplete] (net.js:844:14) errno: 'EPIPE', code: 'EPIPE', syscall: 'write' } Error: EPIPE { Error: write EPIPE at WriteWrap.afterWrite [as oncomplete] (net.js:844:14) errno: 'EPIPE', code: 'EPIPE', syscall: 'write' } Error: EPIPE { Error: write EPIPE at WriteWrap.afterWrite [as oncomplete] (net.js:844:14) errno: 'EPIPE', code: 'EPIPE', syscall: 'write' } Error: EPIPE { Error: write EPIPE at WriteWrap.afterWrite [as oncomplete] (net.js:844:14) errno: 'EPIPE', code: 'EPIPE', syscall: 'write' } Error: EPIPE { Error: write EPIPE at WriteWrap.afterWrite [as oncomplete] (net.js:844:14) errno: 'EPIPE', code: 'EPIPE', syscall: 'write' } Error: EPIPE { Error: write EPIPE at WriteWrap.afterWrite [as oncomplete] (net.js:844:14) errno: 'EPIPE', code: 'EPIPE', syscall: 'write' } Error: EPIPE { Error: write EPIPE at WriteWrap.afterWrite [as oncomplete] (net.js:844:14) errno: 'EPIPE', code: 'EPIPE', syscall: 'write' } Error: EPIPE { Error: write EPIPE at WriteWrap.afterWrite [as oncomplete] (net.js:844:14) errno: 'EPIPE', code: 'EPIPE', syscall: 'write' } Error: EPIPE { Error: write EPIPE at WriteWrap.afterWrite [as oncomplete] (net.js:844:14) errno: 'EPIPE', code: 'EPIPE', syscall: 'write' } Error: EPIPE { Error: write EPIPE at WriteWrap.afterWrite [as oncomplete] (net.js:844:14) errno: 'EPIPE', code: 'EPIPE', syscall: 'write' } Error: EPIPE { Error: write EPIPE at WriteWrap.afterWrite [as oncomplete] (net.js:844:14) errno: 'EPIPE', code: 'EPIPE', syscall: 'write' } Error: EPIPE { Error: write EPIPE at WriteWrap.afterWrite [as oncomplete] (net.js:844:14) errno: 'EPIPE', code: 'EPIPE', syscall: 'write' } Error: undefined Error: 1996252528:error:1408F10B:SSL routines:SSL3_GET_RECORD:wrong version number:../deps/openssl/openssl/ssl/s3_pkt.c:365:

Error: EPIPE { Error: write EPIPE at WriteWrap.afterWrite [as oncomplete] (net.js:844:14) errno: 'EPIPE', code: 'EPIPE', syscall: 'write' } Error: EPIPE { Error: write EPIPE at WriteWrap.afterWrite [as oncomplete] (net.js:844:14) errno: 'EPIPE', code: 'EPIPE', syscall: 'write' } Error: EPIPE { Error: write EPIPE at WriteWrap.afterWrite [as oncomplete] (net.js:844:14) errno: 'EPIPE', code: 'EPIPE', syscall: 'write' } Error: EPIPE { Error: write EPIPE at WriteWrap.afterWrite [as oncomplete] (net.js:844:14) errno: 'EPIPE', code: 'EPIPE', syscall: 'write' } Error: undefined Error: This socket is closed at Socket._writeGeneric (net.js:705:18) at Socket._write (net.js:760:8) at doWrite (_stream_writable.js:406:12) at writeOrBuffer (_stream_writable.js:392:5) at Socket.Writable.write (_stream_writable.js:290:11) at Socket.ondata (_stream_readable.js:646:20) at Socket.emit (events.js:180:13) at addChunk (_stream_readable.js:269:12) at readableAddChunk (_stream_readable.js:256:11) at Socket.Readable.push (_stream_readable.js:213:10) Error: undefined Error: 1996252528:error:1408F10B:SSL routines:SSL3_GET_RECORD:wrong version number:../deps/openssl/openssl/ssl/s3_pkt.c:365:

Error: undefined Error: 1996252528:error:1408F10B:SSL routines:SSL3_GET_RECORD:wrong version number:../deps/openssl/openssl/ssl/s3_pkt.c:365:

Error: ERR_TLS_HANDSHAKE_TIMEOUT Error [ERR_TLS_HANDSHAKE_TIMEOUT]: TLS handshake timeout at TLSSocket._handleTimeout (_tls_wrap.js:592:22) at Object.onceWrapper (events.js:272:13) at TLSSocket.emit (events.js:180:13) at TLSSocket.Socket._onTimeout (net.js:396:8) at ontimeout (timers.js:466:11) at tryOnTimeout (timers.js:304:5) at Timer.listOnTimeout (timers.js:267:5)

codyc1515 commented 4 years ago

You may need to run the following command to install the latest version which has a bug fix for these devices:

npm i -g homebridge-tuya-lan@rc

mitch7391 commented 4 years ago

I am using an Arlec smart bulb and am getting the same error when trying to discover the key and ID. I also just tried the patch that Cody suggested and it is still not working...

TheHomekitWayFinder commented 4 years ago

Can you send me a link to devices and I’ll have a look and see if I can figure out what’s going wrong

Sent with GitHawk

mitch7391 commented 4 years ago

@TheHomekitWayFinder if you meant a link to the product, here it is:

https://www.bunnings.com.au/arlec-smart-4w-380lm-warm-white-ses-candle-globe-with-grid-connect_p0111507

I’d provide @aurorus86’s too but not quite sure which one it is.

TheHomekitWayFinder commented 4 years ago

What app have you got the bulb set up in

Sent with GitHawk

mitch7391 commented 4 years ago

It uses the Grid Connect app, but as part of your set up procedure I was using the Tuya Smart app.

TheHomekitWayFinder commented 4 years ago

I own the arlec 5 outlet smart powerboats and that works really well, and I have that set up in the Rita smart app because I find its more reliable. I would recommend you set up the device in the TuyaSmart smart app and then aquiring the is and key. Have enable full trust for the certificate on your iPhone as I hadn’t done that and I in turn wasn’t able to acquire the key of the device.

Sent with GitHawk

mitch7391 commented 4 years ago

This is my first device using Tuya and I have followed the setup procedure, including the full trust on the certificate. In my ssh terminal it doesn’t display the id or key when I open the Tuya app... The app also then has trouble connecting to the network whilst the proxy is set up.

TheHomekitWayFinder commented 4 years ago

Have you tried connecting your raspberry pi into a monitor or tv instead of using ssh

Sent with GitHawk

mitch7391 commented 4 years ago

I could do, but I am not sure how that would affect the problem between Tuya and Homebridge not communicating though..?

TheHomekitWayFinder commented 4 years ago

I’ve never tried running home bridge on raspberry pi as I use an old windows pc that I also use as a media server, so I dont have experience using ssh so I would recommend you just try connecting the raspberry pi to a screen or alternatively try running Tuya-lan-find on another device and see wether that works

Sent with GitHawk

aurorus86 commented 4 years ago

Hi, great to see i’m not the only Aussie interested!

My set up is a raspberry pi, using homebridge to interface with ios’ homekit. I ran tuya find directly on the pi and didn’t ssh, when following the set up guide.

This is the switch i’m using: https://www.arlec.com.au/detail-2/?de=PC189HA#

Bunnings (a major hardware store in Australia, similar to Home Depot in the States) is the retail seller, and have recently rolled a number of Arlec smart products - it appears to be an Aussie business partnership. They had a recent sale with two smart plug switches and two bulbs for $50AUD!. So i’m also testing some Arlec bulbs (not RGB, but dimmable and has temperature gradients)

Reminder I have one working arlec switch (managed to get the key etc). I recently had to restart my pi and the switch was discovered (based on the log) but was unresponsive on ios homekit until I used the tuya app to switch it on/off. I killed the tuya app and is working again with homekit automations.

Confirming that I’m using tuya app and not Arlec’s GRID connect app to initially discover the devices.

Might move to Home Assistant if this set up is difficult to configure as I add more devices

mitch7391 commented 4 years ago

@aurorus86 so you didn’t have any troubles setting up your first device? I still can’t get it to discover my light. Funny thing is in the app I notice it says the IP address is 106.68.71.202 (none of my IP addresses are of this form, mine start with 192.168, but during the Tuya set up the IP address for the proxy is 192.168.0.155. I wonder if this is part of my problem? I can use it from the app, just can’t get it on Homebridge.

aurorus86 commented 4 years ago

106.68.71.202 appears to be an external ip address from the tuya app. I used a network scanner to work out the internal ip address of the arlec device

Yes, i did have trouble getting the key for my first device.

I haven’t had time to update plug in yet. But will let you know if it works for me

mitch7391 commented 4 years ago

Any suggestions on what scanner to use for a noob? Haha...

TheHomekitWayFinder commented 4 years ago

In my app the IP address is different to what it shows up as in my router settings. So if you just log in to your router settings it will show up there with the name esp-xxx so you would just need to find the right one based on the MAC addresses. I haven’t had any experience with the grid connect bulbs as I use IKEA Trådfri which I find works very well and I’m waiting for the full range of products that they have over in the US and UK to be released here.

Sent with GitHawk

mitch7391 commented 4 years ago

I did have a look in my router settings but was only looking for the two addresses I stated before, I will look for a name of that form and see if I have any luck. If that finds a new IP address for me, do I punch that in as Tuya-lan-find —ip or do I use it in my proxy setup? Also @aurorus86 sorry hijacking your issue haha

mitch7391 commented 4 years ago

Found my IP address on my router, but using it was tuya-lan-find --ip it just states:

The requested IP, 192.168.0.136, is not a valid external IPv4 address. The valid options are: 192.168.0.155

Which is the IP address (my homebridge Pi) the standard command gives anyway, which I had orignally been using for the proxy setup.

mitch7391 commented 4 years ago

However, going back to the original setup instructions and doing one thing slightly different, having the tuya app open before I execute the tuya-lan-find command, the my ssh terminal outputs the following consistently (when oringally I was getting the error that @aurorus86 was getting):

_tls_common.js:124 c.context.setCert(cert); ^

Error: error:0906D06C:PEM routines:PEM_read_bio:no start line at Object.createSecureContext (_tls_common.js:124:17) at Server (_tls_wrap.js:878:25) at new Server (https.js:62:14) at Object.createServer (https.js:83:10) at Proxy._createHttpsServer (/home/pi/.nvm/versions/node/v10.0.0/lib/node_modules/homebridge-tuya-lan/node_modules/http-mitm-proxy/lib/proxy.js:106:27) at /home/pi/.nvm/versions/node/v10.0.0/lib/node_modules/homebridge-tuya-lan/node_modules/http-mitm-proxy/lib/proxy.js:493:16 at /home/pi/.nvm/versions/node/v10.0.0/lib/node_modules/homebridge-tuya-lan/node_modules/http-mitm-proxy/node_modules/async/dist/async.js:473:16 at processQueue (/home/pi/.nvm/versions/node/v10.0.0/lib/node_modules/homebridge-tuya-lan/node_modules/http-mitm-proxy/node_modules/async/dist/async.js:1578:20) at taskComplete (/home/pi/.nvm/versions/node/v10.0.0/lib/node_modules/homebridge-tuya-lan/node_modules/http-mitm-proxy/node_modules/async/dist/async.js:1601:9) at /home/pi/.nvm/versions/node/v10.0.0/lib/node_modules/homebridge-tuya-lan/node_modules/http-mitm-proxy/node_modules/async/dist/async.js:1625:17

TheHomekitWayFinder commented 4 years ago

Have you tried updating to the latest RC and then reinstalling the certificate

Sent with GitHawk

mitch7391 commented 4 years ago

I did update to the latest version, but didn’t reinstall a new certificate after doing that. Just tried it now and I am back to the ‘EPIPE’ error again. It seems to be a time out sort of error when you give up and turn off the proxy settings.

TheHomekitWayFinder commented 4 years ago

@aurorus86 have you tried updating to the latest RV after deleting the certificate on your phone and then reinstalling the new certificate as that fixed someone else’s issue with one of the Kogan SmarterHome smart plugs #113

Sent with GitHawk

TheHomekitWayFinder commented 4 years ago

@mitch7391 when I am trying to discover a new device I make sure that everything is closed after I install the certificate, give it full trust and then set the correct proxy settings. I then wait about 30 seconds before I open the TuyaSmart app keep in mind it takes about 45 seconds for the TuyaSmart app to finish loading at which time the key and id of any devices loading in the app. Cause the key and if don’t appear immediately in the console

Sent with GitHawk

mitch7391 commented 4 years ago

Reading your comment to the issue and gave that a go just then as before I had other apps open, however tried all over again and still the EPIPE error 😕

mitch7391 commented 4 years ago

@AMoo-Miki is this something you might be able to take a look at?

aurorus86 commented 4 years ago

Thank you both to contributing.

Confirming that I can obtain a key. Version of tuya-lan I'm using is 1.5.0-rc.12, which was the same version before I ran an NPM update - i think.

So I assume I must have missed a step in the set up? I did get the tuya-app to refresh by dragging down, and then the key popped out. Also killed the tuya app and restarted per set up instruction

Thanks!

mitch7391 commented 4 years ago

So it ended up working for you @aurorus86 ? I still have not been able to get it to work. Tuya app gets the network error whilst I’m the proxy set up like in the issue TheHomekitWayFinder linked. My terminal just sits there waiting and not showing a key or ID, then after 5+ mins I disconnect the proxy setup and the EPIPE errors populate my terminal.

aurorus86 commented 4 years ago

@mitch7391 yep - I have the keys for my new switches and an arlec white bulb, which I used to add new devices in the config.json The two switches shows up on the ios home app. Initially as unresponsive, but after I tapped the physical blue/clear switch on the outlet, I was able to control the outlets on the ios home app (see extract from sys log).

I can't get the bulb to respond though, after getting the key and adding as a device. Similar behaviour to the outlets above. Initially showing as unresponsive in red in the home app. I used the tuya app to send a few commands, killed the tuya app. The unresponsive error in the ios home app disappears, but I still have no control on the bulb. I've attached a sys log. @TheHomekitWayFinder @AMoo-Miki any ideas? sys log

[2019-11-16 15:36:25] Loaded config.json with 2 accessories and 2 platforms. [2019-11-16 15:36:25] --- [2019-11-16 15:36:27] Loaded plugin: homebridge-orbit-bhyve [2019-11-16 15:36:27] Registering accessory 'homebridge-orbit-bhyve.OrbitBHyve' [2019-11-16 15:36:27] --- [2019-11-16 15:36:28] Loaded plugin: homebridge-people [2019-11-16 15:36:28] Registering platform 'homebridge-people.People' [2019-11-16 15:36:28] Registering accessory 'homebridge-people.PeopleAccessory' [2019-11-16 15:36:28] Registering accessory 'homebridge-people.PeopleAllAccessory' [2019-11-16 15:36:28] --- [2019-11-16 15:36:28] Loaded plugin: homebridge-raspberrypi-temperature [2019-11-16 15:36:28] Registering accessory 'homebridge-raspberrypi-temperature.RaspberryPiTemperature' [2019-11-16 15:36:28] --- [2019-11-16 15:36:28] Loaded plugin: homebridge-tplink-smarthome [2019-11-16 15:36:28] Registering platform 'homebridge-tplink-smarthome.TplinkSmarthome' [2019-11-16 15:36:28] --- [2019-11-16 15:36:29] Loaded plugin: homebridge-tuya-lan [2019-11-16 15:36:29] Registering platform 'homebridge-tuya-lan.TuyaLan' [2019-11-16 15:36:29] --- [2019-11-16 15:36:29] Loaded plugin: homebridge-wol [2019-11-16 15:36:29] Registering accessory 'homebridge-wol.NetworkDevice' [2019-11-16 15:36:29] --- [2019-11-16 15:36:29] Loading 2 platforms... [2019-11-16 15:36:29] [Tp] Initializing TplinkSmarthome platform... [2019-11-16 15:36:29] [Tp] homebridge-tplink-smarthome v4.0.1, node v9.9.0, homebridge v0.4.50 [2019-11-16 15:36:29] [TuyaLan] Initializing TuyaLan platform... [2019-11-16 15:36:29] Loading 2 accessories... [2019-11-16 15:36:29] [Example PC] Initializing NetworkDevice accessory... [2019-11-16 15:36:29] [Example PC] Stopping pinger [2019-11-16 15:36:29] [Example PC] Starting pinger at an interval of 15000 milli seconds [2019-11-16 15:36:29] [Pi Temp] Initializing RaspberryPiTemperature accessory... [2019-11-16 15:36:29] [Tp] Configuring cached accessory: [Hallway lamp] 80064F73D1065AD7CACF7972FB917C6C1BE51F34 76a36842-bd64-4d62-bada-c7e8fd0162c5 [2019-11-16 15:36:29] [TuyaLan] Marked arlecswitch unreachable by faulting Service.arlecswitch.On [2019-11-16 15:36:29] [TuyaLan] Marked airwick unreachable by faulting Service.airwick.On [2019-11-16 15:36:29] [TuyaLan] Marked Arlec White Light unreachable by faulting Service.Arlec White Light.On Setup Payload: X-HM://0023ISYXUI2O9 Scan this code with your HomeKit app on your iOS device to pair with Homebridge: . . .

[2019-11-16 15:36:29] [TuyaLan] Starting discovery... [2019-11-16 15:36:29] Homebridge is running on port 51826. [TuyaDiscovery] Discovery started on port 6666. [TuyaDiscovery] Discovery started on port 6667. [2019-11-16 15:36:29] [Tp] New Device Online: [Hallway lamp] plug [xxx] 192.168.0.7 9999 [2019-11-16 15:36:29] [Tp] Adding: [Hallway lamp] plug [xxx] [2019-11-16 15:36:31] [TuyaLan] Discovered Arlec White Light (xxx) identified as TWLight (3.3) [TuyaAccessory] Changing ping gap for Arlec White Light to 9s [2019-11-16 15:36:31] [TuyaLan] Connected to Arlec White Light [2019-11-16 15:36:32] [TuyaLan] Discovered arlecswitch (xxx identified as Outlet (3.3) [TuyaAccessory] Changing ping gap for arlecswitch to 9s [2019-11-16 15:36:32] [TuyaLan] Connected to arlecswitch [2019-11-16 15:36:32] [TuyaLan] Discovered airwick (xxx) identified as outlet (3.3) [TuyaAccessory] Changing ping gap for airwick to 9s [2019-11-16 15:36:32] [TuyaLan] Connected to airwick [TuyaAccessory] Heard back from Arlec White Light with command 8 [2019-11-16 15:41:42] [TuyaLan] Ready to handle Arlec White Light (TWLight:3.3) with signature {"20":false} [TuyaAccessory] Heard back from Arlec White Light with command 8 [TuyaAccessory] Sending Arlec White Light {"2":255} [TuyaAccessory] Sending Arlec White Light {"1":true} [TuyaAccessory] Sending Arlec White Light {"1":false} [TuyaAccessory] Sending Arlec White Light {"1":true} [TuyaAccessory] Sending Arlec White Light {"1":false} [TuyaAccessory] Sending Arlec White Light {"1":true} [TuyaAccessory] Sending Arlec White Light {"1":false} [TuyaAccessory] Sending Arlec White Light {"1":true} [TuyaAccessory] Sending Arlec White Light {"1":false} [TuyaAccessory] Heard back from arlecswitch with command 8 [2019-11-16 15:42:45] [TuyaLan] Ready to handle arlecswitch (Outlet:3.3) with signature {"1":true} [TuyaAccessory] Heard back from arlecswitch with command 8 [TuyaAccessory] Sending arlecswitch {"1":true} [TuyaAccessory] Heard back from arlecswitch with command 8 [TuyaAccessory] Sending arlecswitch {"1":false} [TuyaAccessory] Heard back from arlecswitch with command 8

aurorus86 commented 4 years ago

Hi @AMoo-Miki and @TheHomekitWayFinder, I've tried changing the bulb type to SimpleLight and it still doesn't work. So requesting @AMoo-Miki a device support please. Details are below per your device support page, including schema, signatures, descriptions and product websites. Hopefully you are back working on this product soon, I like how tuya-lan is set up to work in a home network with out a cloud server, if I understand how it works correctly. In the meantime I'm going to check out home assistant - and look forward to the next update.

Homebridge Tuya-Lan Device Support Request Courtesy of aurorus86

https://github.com/AMoo-Miki/homebridge-tuya-lan/wiki

(a) the name and type of your device:

The devices are found in a starter kit from Arlec's GRID connect products, but also sold indivdually see below. Retailer is Bunnings Warehouse, manufacture is Arlec, brand is GRID connect. Websites: i) https://www.bunnings.com.au/arlec-smart-starter-kit-with-grid-connect-2x-smart-a60-bc-led-globes-and-2x-smart-plug-in-sockets_p0111096 ii) https://www.bunnings.com.au/our-range/build-a-smart-home/grid-connect-compatible-products iii) https://grid-connect.com.au/ iv) https://www.arlec.com.au/our-product/

There are three Arlec devices on my network i) Arlec's GLD115HA-7c3eA: a white bulb, dimmable with temperature control. Website: https://www.bunnings.com.au/arlec-smart-9-5w-806lm-cct-bc-globe-with-grid-connect_p0111502 ii) Arlec's Single Adaptor PC189HA: A Smart Plug In Socket/outlet. Website: https://www.bunnings.com.au/arlec-smart-plug-in-socket-with-grid-connect_p0135440 iii) as above. Renamed as airwick in below schema

(b) the schema and, if there is one, the extras: see below. Airwick is just another outlet switch, same as Arlec's outlet: "Single Adaptor PC189HA"

(c) the signature: i) Ready to handle Arlec White Light (SimpleLight:3.3) with signature {"20":false} [NOTE: this should be Arlec's white bulb - GLD115HA-7c3e] ii) Ready to handle arlecswitch (Outlet:3.3) with signature {"1":false} [NOTE: this is Arlec's outlet: "Single Adaptor PC189HA"] iii) Ready to handle airwick (Outlet:3.3) with signature {"1":true} [NOTE: this is Arlec's outlet: "Single Adaptor PC189HA"]

(d) if you find one, a link to its description or where it is sold online: see (a) above

Found 3 devices: [ { name: 'GLD115HA-7c3e', id: 'xxx', key: 'xxx', def: { schema: '[{"mode":"rw","code":"switch_led","name":"\u5f00\u5173","property":{"type":"bool"},"iconname":"icon-dp_power2","id":20,"type":"obj","desc":""},{"mode":"rw","code":"work_mode","name":"\u6a21\u5f0f","property":{"range":["white","colour","scene","music"],"type":"enum"},"iconname":"icon-dp_list","id":21,"type":"obj","desc":""},{"mode":"rw","code":"bright_value","name":"\u4eae\u5ea6\u503c","property":{"unit":"","min":10,"max":1000,"scale":0,"step":1,"type":"value"},"iconname":"icon-dp_sun","id":22,"type":"obj","desc":""},{"mode":"rw","code":"temp_value","name":"\u51b7\u6696\u503c","property":{"unit":"","min":0,"max":1000,"scale":0,"step":1,"type":"value"},"iconname":"icon-dp_half","id":23,"type":"obj","desc":""},{"mode":"rw","code":"scene_data","name":"\u573a\u666f","property":{"type":"string","maxlen":255},"iconname":"icon-dp_box2","id":25,"type":"obj","desc":""},{"mode":"rw","code":"countdown","name":"\u5012\u8ba1\u65f6\u5269\u4f59\u65f6\u95f4","property":{"unit":"","min":0,"max":86400,"scale":0,"step":1,"type":"value"},"iconname":"icon-timer1","id":26,"type":"obj","desc":""},{"mode":"wr","code":"control_data","name":"\u8c03\u8282","property":{"type":"string","maxlen":255},"iconname":"icon-setting","id":28,"type":"obj","desc":""}]', extras: '[{"id":22,"inputStyle":"","inputType":""},{"id":23,"inputStyle":"","inputType":""},{"id":26,"inputStyle":"","inputType":""}]', }, }, { name: 'Air Wick', id: 'xxx', key: 'xxx', def: { schema: '[{"mode":"rw","code":"switch_1","name":"\u5f00\u51731","property":{"type":"bool"},"iconname":"icon-dp_power2","id":1,"type":"obj","desc":""},{"mode":"rw","code":"countdown_1","name":"\u5f00\u51731\u5012\u8ba1\u65f6","property":{"unit":"s","min":0,"max":86400,"scale":0,"step":1,"type":"value"},"iconname":"icon-dp_time2","id":9,"type":"obj","desc":""}]', extras: '[{"id":9,"inputStyle":"","inputType":"countdown"}]', }, }, { name: 'Single Adaptor PC189HA', id: 'xxx', key: 'xxx', def: { schema: '[{"mode":"rw","code":"switch_1","name":"\u5f00\u51731","property":{"type":"bool"},"iconname":"icon-dp_power2","id":1,"type":"obj","desc":""},{"mode":"rw","code":"countdown_1","name":"\u5f00\u51731\u5012\u8ba1\u65f6","property":{"unit":"s","min":0,"max":86400,"scale":0,"step":1,"type":"value"},"iconname":"icon-dp_time2","id":9,"type":"obj","desc":""}]', extras: '[{"id":9,"inputStyle":"","inputType":"countdown"}]', }, }, ]

TheHomekitWayFinder commented 4 years ago

I have just tested the tuya-lan-find again on my windows pc that im running it on, and it worked fine. The id and key appear about 5 seconds after the weather information appeared at the top of the screen in the TuyaSmart App. IMG_0271 IMG_0272 IMG_0273

aurorus86 commented 4 years ago

@TheHomekitWayFinder. Thanks. Confirming Tuya-Lan-Find works for me too. That’s how it got the schema above.

You said you only have have a powerboard and no Arlec bulbs? So you cant confirm whether or not you can control these bulbs via the ios home app? I can’t switch them on or off. The log in homebridge says its discovered and ready (i assume this means the key is working) but when it sends a signal to turn on the bulb, those no message back from the bulb (like i normally see with the outlets)

Ta

TheHomekitWayFinder commented 4 years ago

@aurorus86 you said that you managed to get one of the plugs working as I am now intrigued as Have been able to acquire the is and key of the Arlec plug that I got today but I am unable to control the device and I get a flood of errors of socket errors and that homebridge will try to reconnect. I have updated homebridge to the latest RC before i discovered the I’d and key of the device and since I am now experiencing an error with my power board as well so I’m wondering if it’s a issue with the updated version of Tuya-lan. The homebridge console then says that if the error continues to occur then it’s likely to a incompatibility. So I’m not sure anymore. It would be interesting to know if it would have worked if I hadn’t updated homebridge-Tuya-lan.

aurorus86 commented 4 years ago

@TheHomekitWayFinder Hi! No haven’t ran any updates and it still works. I did a reboot of the pi I think about 1-2 weeks ago, and went through usual process of sending an on/off command via tuya app, before homebridge recognises, and able to control the outlets.

If you did an update recently, then that might be the issue. What did you update?

TheHomekitWayFinder commented 4 years ago

@aurorus86 The other day I had a bit of a play around with the plugin and I found that everything started working when I uninstalled homebridge-tuya-lan and then reinstalled RC-11 which fixed my issues. So I don't know whether that might make a difference to your bulbs or not.

aurorus86 commented 4 years ago

@TheHomekitWayFinder -ok, i’m on rc-12, so rc-11 may or may not work with these Arlec bulbs. Won’t get much time to test before xmas. To be honest want to check out home assistant to see if that’s easier to configure.

Are your outlets working yet?

TheHomekitWayFinder commented 4 years ago

@aurorus86, since i reverted back to a older version of the plugin all of my arlec devices, are functioning correctly again. Both of my powerboards are working again and the plug im guessing would have worked correclty if i still had it but i returned it for another powerboard which gave me outlets. I'm still not sure about the bulbs whether or not they would work as i dont own any but i might look at picking some up soon.

mitch7391 commented 4 years ago

I finally got around to trying to work further on this one. It seems that when I used rc-12 and followed the same process I was before (the setup instructions), it worked flawlessly. I now have my ID and key. The devices has now been added to HomeKit, however it doesn’t seem to recognise the current state (I had it on and it reported back as off) and I have not been able to send commands to it. So at least that is progress, I haven’t had time to look into it further. I did try rc-11 (think I did that correctly) and still the same issue of no control.

aurorus86 commented 4 years ago

Hi @mitch7391

Try opening the tuya app send a on/off command. Kill tuya app. Then open home app and try sending commands there. For some reason, this initiates the powerplug when it’s first set up. I think I explained this above. You can also check the logs to see what is happening.

Good luck

David

mitch7391 commented 4 years ago

Sorry @aurorus86 i must have overlooked that comment. Just gave it a go then but no luck, still the same issue. I wonder if I have it set the right light type, as from a Homebridge log point of view it looks to be working (no errors and issuing commands). It is a warm white dimmable light, I can’t adjust colour temperature though. TWlight didn’t work so now I’m trying SimpleLight and still no luck. I might open an issue of my own as I have high jacked yours enough. But just quickly what version of the plug-in are you using? And if it was one of the older ones what was the exact command you used to install it (in case I installed the wrong one)?

mitch7391 commented 4 years ago

Scrap that last part, I have found how to make sure I have installed the correct versions :)

L4RGER commented 4 years ago

In regards to device id and key for Arlec globes, I tried burp proxy and couldn’t get a response using TuyaSmart app, after not being able to get a response through tuya-lan-find. Then I tried tuya-lan-find again and the grid connect app. It was successful, I set the proxy up and unpaired the globe and re-paired and they came straight up in terminal window.