diff --git a/src/httpserver/new_http.c b/src/httpserver/new_http.c index 522cf1d06..7583e89f5 100644 --- a/src/httpserver/new_http.c +++ b/src/httpserver/new_http.c @@ -308,8 +308,8 @@ template_t g_templates [] = { { Setup_Device_ArlecCCTDownlight, "Arlec CCT LED Downlight ALD029CHA"}, { Setup_Device_NedisWIFIPO120FWT_16A, "Nedis WIFIPO120FWT SmartPlug 16A"}, { Setup_Device_NedisWIFIP130FWT_10A, "Nedis WIFIP130FWT SmartPlug 10A"}, - { Setup_Device_EmaxHome_EDU8774, "Emax Home EDU8774 SmartPlug 16A"} - + { Setup_Device_EmaxHome_EDU8774, "Emax Home EDU8774 SmartPlug 16A"}, + { Setup_Device_TuyaSmartPFW02G, "Tuya Smart PFW02-G"} }; int g_total_templates = sizeof(g_templates)/sizeof(g_templates[0]); diff --git a/src/new_builtin_devices.c b/src/new_builtin_devices.c index 6b4ffe502..3fbe3dc80 100644 --- a/src/new_builtin_devices.c +++ b/src/new_builtin_devices.c @@ -248,4 +248,25 @@ void Setup_Device_EmaxHome_EDU8774() { PIN_SetPinChannelForPinIndex(26, 1); PIN_SaveToFlash(); -} \ No newline at end of file +} + +// https://www.tokmanni.fi/alypistorasia-home-connect-ip20-6419860720456 +// Marked as Smart-PFW02-G +// Relay (with npn-transistor) at PWM4 P24 +// Button PWM5 P26 +// LED PWM1 P7 +void Setup_Device_TuyaSmartPFW02G() { + PIN_ClearPins(); + + PIN_SetPinRoleForPinIndex(24, IOR_Relay_n); + PIN_SetPinChannelForPinIndex(24, 1); + + PIN_SetPinRoleForPinIndex(26, IOR_Button); + PIN_SetPinChannelForPinIndex(26, 1); + + PIN_SetPinRoleForPinIndex(7, IOR_LED); + PIN_SetPinChannelForPinIndex(7, 1); + + + PIN_SaveToFlash(); +} diff --git a/src/new_pins.h b/src/new_pins.h index 3c18a8432..690526b2d 100644 --- a/src/new_pins.h +++ b/src/new_pins.h @@ -64,6 +64,7 @@ void Setup_Device_ArlecCCTDownlight(); void Setup_Device_NedisWIFIPO120FWT_16A(); void Setup_Device_NedisWIFIP130FWT_10A(); void Setup_Device_EmaxHome_EDU8774(); +void Setup_Device_TuyaSmartPFW02G(); #endif