bewee / tuya-adapter

GNU General Public License v3.0
8 stars 8 forks source link

flash_scene_[1-4] support #42

Open dkoppenh opened 2 years ago

dkoppenh commented 2 years ago

I got a Feit Electric bulb working with this add-on.

There is one feature of the Feit vendor app that would be nice to have in the gateway: Tuya "flash scenes", which are listed under the "Effects" tab of the Feit app.

API documentation is here https://developer.tuya.com/en/docs/iot/dj?id=K9i5ql3v98hn3#title-14-flash_scene_1

I used the Tuya IoT Platform to set and activate the effects, so I know it can be done outside of the vendor app.

If there's anything I can do to help, I'm willing.

Thanks, David

bewee commented 2 years ago

Hi @dkoppenh,

Nice idea! I vaguely remember a similar feature from my tuya-branded bulbs as well, but didn't feel the urge to implement it for this addon since I never used it. I currently don't have the resources to tackle this myself, but would happily review a PR of yours and also test it with my bulbs :)

Regards :)

dkoppenh commented 2 years ago

I found a dps reference here https://tasmota.github.io/docs/TuyaMCU/#lighting

My device didn't report the dps numbers with tuyadebug's test.py until I submitted the calls via Tuya's API Explorer, but now I have values for dps 6-10. 6 (scene_data) looks like dps 5 (colour_data), so I'm not going to explore that much more. But dps 7-10 indeed correspond to the effects.

flash_scene_1 and flash_scene_3 just have 1 set of hsv values, and flash_scene_2 and flash_scene_4 probably have up to 6, if the Feit app is any indication.

I can't do much else until I learn more about how this add-on works. I imagine scenes 1 and 3 would be easier to implement than 2 and 4, since the color picker would be similar to that of work_mode="colour", having only 1 color.

bewee commented 2 years ago

For the basics of how this addon works, please have a look at the CONTRIBUTING.MD. If you have further specific questions feel free to ask here :)