RavenSystem / esp-homekit-devices

Advanced firmware to add native Apple HomeKit and custom configurations, compatible with any SoC based on ESP32, ESP32-S, ESP32-C and ESP8266 series. (Shelly, Sonoff, Electrodragon, Tuya...)
Other
2.76k stars 361 forks source link

Tuya SWA1 with esp8266 Smart plug #320

Closed massimo79 closed 5 years ago

massimo79 commented 5 years ago

Hy! I correctly flashed the Tuya Smart plug with the ravencore firmware since the esp is compatible. Only thing is that the GPIO connectivity is different from Sonoff and relay doesn’t trigger. GPIO should be something like this: GPIO4: Led GPIO5: Relay GPIO13: Button Since these plugs are very popular, could you make a “board type” for these? Thanks from your friends in Italy!

GPL71 commented 5 years ago

@RavenSystem Josè it would be interesting a solution like the follow The GPIO list where default set is NONE The user may choose and assigne the function to GPIO e.g. output, input, led and other....

What do you think?

RavenSystem commented 5 years ago

@GPL71 HAA firmware will work in a similar way. You will can setup each GPIO using a JSON string like: { type: "switch", relay_gpio: 4, button_gpio: 8 }

massimo79 commented 5 years ago

@RavenSystem Will the setup be available also in Eve?

GPL71 commented 5 years ago

@RavenSystem Josè without words .... Great!!!! Have you any idea when we'll see a first release about? @massimo79 I think by web ... Josè wrote something about ... I think this firmware will be something we can't image at the moment....

massimo79 commented 5 years ago

@RavenSystem I can beta test (if you like) the GPIO settings in the new HAA when the beta is available.

jorgemartins commented 5 years ago

Hey @massimo79, out of curiosity, have you flashed the tuya device through the serial port or with OTA tool like Tuya-convert ?

I'm asking because @RavenSystem just recently created a joined .bin #364 that could be used in a OTA approach, but you flashed it before him doing that so you could have your methods :)

massimo79 commented 5 years ago

Hi @jorgemartins, I flashed the Tuya switch with a usb serial adaptor and no need of soldering. Hard erasing and uploading new firmware had no issues, problem is the GPIO settings that don’t make it work!

jorgemartins commented 5 years ago

hey @massimo79 just noticed HAA was released → https://github.com/RavenSystem/esp-homekit-devices/wiki/Home-Accessory-Architect

have you tried it to use the correct GPIO? 🤞

massimo79 commented 5 years ago

Hi @jorgemartins not yet! Planning to do so this weekend and I can’t wait to try. I’ll give you feedback if I succeed and will share the json!

RavenSystem commented 5 years ago

JSON for HAA: {"c":{"l":4,"i":1},"a":[{"t":2,"r":[{"g":5}],"b":[{"g":13,"p":1,"t":1}]}]}

https://github.com/RavenSystem/esp-homekit-devices/wiki/HAA-Templates#tuya-swa1-with-esp8266-smart-plug

massimo79 commented 5 years ago

Great @jorgemartins thanks a lot! Con you confirm that I have to reflash the device? (Right now it’s running ravencore).

jorgemartins commented 5 years ago

I think you meant José and not Jorge 😅. Anyway credit goes to @RavenSystem - thank you for your work, by the way!

Regarding your question I think you need to reflash as HAA is a different firmware. I'm not sure if we can simply change the OTA repository without reflash. Can we @RavenSystem ?

massimo79 commented 5 years ago

Sorry @RavenSystem..my mistake! 🤪

jorgemartins commented 5 years ago

Hey @massimo79, you closed the issue but didn’t mention if you were successful with having homekit on your tuya device 😬. Thank you

RavenSystem commented 5 years ago

To install HAA is necessary to erase flash and start from scratch.

massimo79 commented 5 years ago

@jorgemartins unfortunately no! The device doesn’t work correctly in AP mode (the first time LCM showed up but wasn’t able to add device to Homekit, in other attempts LCM never showed up and I wasn’t able to download HAA). I will try again!

massimo79 commented 5 years ago

@jorgemartins @RavenSystem issue closed by mistake and reopened.

RavenSystem commented 5 years ago

I suggest to flash LCM firmware, and then connect device to 230VAC and do the rest of installation (wifi setup, repo, ...).

franklindee commented 5 years ago

hi do you know how to reset the HAA and redo the configuration?

hejsiri commented 5 years ago

JSON for HAA: {"c":{"l":4,"i":1},"a":[{"t":2,"r":[{"g":5}],"b":[{"g":13,"p":1,"t":1}]}]}

https://github.com/RavenSystem/esp-homekit-devices/wiki/HAA-Templates#tuya-swa1-with-esp8266-smart-plug

Will it work with the Tuya PP-W162 socket? How can I change the software without soldering the wires. Access to the pins is so difficult and requires desoldering the entire motherboard. Hour of work.

2F159B23-0265-4953-B4E6-BB61CA5B5ADD 04BE31C4-631F-412B-90B9-C228B1828504 D8E2EE48-897B-4868-8933-2BC044F119C0 BD732912-97B3-4C3D-946D-AB1D9E3DEF0A