paullj1 / TreatLife-HomeKit

Open source firmware for the TreatLife DS0X dimmer switches for native HomeKit use.
MIT License
9 stars 5 forks source link

DS02S #10

Closed boboxx closed 1 year ago

boboxx commented 2 years ago

I'm having a issue loading some DS02S. They have a board version 2.1 2020/06/23. Main module FW was 1.1.71 and MCU v3.6.2.

The WIFI adapter it came wit was a WB3S so I replaced them with some ESP-12S. I'm able to load your FW, connect it to my network using the WIFI manager and I'm able to add it to HomeKit. I can turn on the light with the physical button, the dimmer works.... BUT HomeKit is unable to control the switch. It toggle the button being on/off but the light does not turn on.

I loaded the bin from release 1.9.1 (DS02S.bin)

boboxx commented 2 years ago

I connected my serial port on the ESP to looked at the communication, I can see the heartbeat and the on and off command:

55 AA 00 06 00 05 01 01 00 01 01 0E 55 AA 00 00 00 00 FF 55 AA 00 06 00 05 01 01 00 01 00 0D 55 AA 00 00 00 00 FF 55 AA 00 00 00 00 FF 55 AA 00 00 00 00 FF 55 AA 00 00 00 00 FF

Looking at the Tuya Developer documentation the command look ok I'm just not sure why HomeKit can con control the switch.

boboxx commented 2 years ago

This is the Tasmota configuration that I used that worked:

Template {"NAME":"DS02S Dimmer","GPIO":[0,107,0,108,0,0,0,0,0,0,0,0,0],"FLAG":0,"BASE":54}

Console BackLog setoption97 1; TuyaMCU 21,2;SetOption20 1; SetOption54 1; TuyaSend2 3,100; DimmerRange 10,1000; TuyaSend4 4,1; SerialSend5 55AA00060005040400010013; ledtable 0; WebLog 2;

boboxx commented 1 year ago

Finally had a chance to look at this again. All that was needed as to change the baud rate. It's working now :)

tuya_init(115200);

paullj1 commented 1 year ago

Excellent!! Sorry I didn’t get a chance to look at that myself. I remember having the same problem for one of the other models. Glad you got to the bottom of it. Did you have a recommendation for a permanent fix? Maybe we just build all the firmwares with both baud rates as options?

paullj1 commented 1 year ago

Ouch. I noticed they started doing that, which I think is illegal in the US (since they haven’t updated the FCC label).

Well done on the ESP-12 replacement! I suspect they may have also changed some of the DpId’s. I reversed all of that using Tasmota since it will talk the Tuya API as well. I’d suggest flashing Tasmota, so you can figure out which DpIds control the light, and dimmer, then we can make a new device type in this repo for it that sends the proper signals.

Sorry you’re having so much trouble, but it sounds like most of the hard work is done!

On Tue, Aug 23, 2022 at 16:34 boboxx @.***> wrote:

I'm having a issue loading some DS02S. They have a board version 2.1 2020/06/23. Main module FW was 1.1.71 and MCU v3.6.2.

The WIFI adapter it came wit was a WB3S so I replaced them with some ESP-12S. I'm able to load your FW, connect it to my network using the WIFI manager and I'm able to add it to HomeKit. I can turn on the light with the physical button, the dimmer works.... BUT HomeKit is unable to control the switch. It toggle the button being on/off but the light does not turn on.

I loaded the bin from release 1.9.1 (DS02S.bin)

— Reply to this email directly, view it on GitHub https://github.com/paullj1/TreatLife-HomeKit/issues/10, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACDPSB2KTTA6S4Q3F5IJLUDV2UYU7ANCNFSM57M35LNA . You are receiving this because you are subscribed to this thread.Message ID: @.***>