thorrak / brewpi-esp8266

An implementation of the BrewPi device code on the ESP8266, ESP32, and ESP32-S2
GNU General Public License v3.0
86 stars 30 forks source link

[Request] Tuya power outlet support #97

Closed bsaurusrex closed 1 year ago

thorrak commented 1 year ago

Can you add links to these devices? (Even better - links to an API for them?)

bsaurusrex commented 1 year ago

The devices are all generic but run under tuya cloud. There is a lot of information available for home assistant addons like "localtuya" or using the traditional tuya cloud API.

https://vi.aliexpress.com/item/1005004562976013.html?spm=a2g0o.productlist.main.31.3399313dQDkOuq&algo_pvid=a2aaa5b0-46e6-409d-8df4-67b788402193&algo_exp_id=a2aaa5b0-46e6-409d-8df4-67b788402193-15&pdp_npi=4%40dis%21SGD%2154.61%2119.66%21%21%2139.10%21%21%402101f49f16925493100876351e3ad0%2112000029630940900%21sea%21SG%212655159861%21&curPageLogUid=NTv3yGJ4QAs0

bsaurusrex commented 1 year ago

https://developer.tuya.com/en/docs/iot/call-api?id=Ka7o7ru1julms

thorrak commented 1 year ago

I’m not likely to end up supporting the cloud, but if there is a (user friendly) way to support the devices locally I might be open. Is there any API documentation out there for local device support?

The critical feature is some way for the switch to shut off if it doesn’t receive a command in a certain period of time instructing it to stay on.

bsaurusrex commented 1 year ago

Localtuya is an option. https://github.com/rospogrigio/localtuya

bsaurusrex commented 1 year ago

I picked up a Kasa outlet.

thorrak commented 1 year ago

Sounds good. I’m still open to adding support for other devices, but the two crucial features I’d like to have in a device are a “dead man’s switch” and local connectivity.

For Kasa switches there is a feature that lets the BrewPi-ESP tell the switch every second, “Hey, stay on for 5 more seconds”. If the BrewPi then crashes (or the router goes down) then you don’t have the risk of your heater/cooler staying on forever and boiling/freezing your beer as it will automatically shut off once that timer is reached.

Kasa switches also happen to have a local, non-cloud protocol which means that if your internet connection fails for any reason (but your router stays alive), your beer will continue to be controlled.