Milfra MFA05F - Tuya Bekken based motion switch

Hoping someone can assist me in getting the rest of the functionality working on a Tuya based motion switch.

Link to yaml I’m trying to get working. I grabbed everything from a config I found on Reddit, but only relay (datapoint 1) and turning white LED off (datapoint 15) is working). Motion doesn’t work for on or off. Here is what the Tuya module advertises:

18:59:37][C][lt.component:013]: LibreTiny:
[18:59:37][C][lt.component:014]:   Version: v1.5.1 on generic-bk7231n-qfn32-tuya, compiled at Sep  4 2024 10:49:43, GCC 10.3.1 (-O1)
[18:59:37][C][lt.component:015]:   Loglevel: 3
[18:59:37][C][tuya:041]: Tuya:
[18:59:37][C][tuya:056]:   Datapoint 1: switch (value: OFF)
[18:59:37][C][tuya:062]:   Datapoint 14: enum (value: 0)
[18:59:37][C][tuya:062]:   Datapoint 15: enum (value: 2)
[18:59:37][C][tuya:056]:   Datapoint 43: switch (value: ON)
[18:59:37][C][tuya:062]:   Datapoint 44: enum (value: 0)
[18:59:37][C][tuya:062]:   Datapoint 45: enum (value: 0)
[18:59:37][C][tuya:056]:   Datapoint 46: switch (value: ON)
[18:59:37][C][tuya:062]:   Datapoint 47: enum (value: 0)
[18:59:37][C][tuya:062]:   Datapoint 48: enum (value: 1)
[18:59:37][C][tuya:058]:   Datapoint 49: int value (value: 34)
[18:59:37][C][tuya:058]:   Datapoint 101: int value (value: 0)
[18:59:37][C][tuya:058]:   Datapoint 102: int value (value: 0)
[18:59:37][C][tuya:054]:   Datapoint 103: raw (value: 00)
[18:59:37][C][tuya:074]:   Product: '{"p":"vd5jgg8vgdbaqerq","v":"1.0.0","m":2}'

If the RAW datapoint 103 has the sensor data in there, could a lambda be used to populate a sensor?

TIA

Did you ever get your yaml to work? How did you set it up to flash? Can’t seem to find anyway to get it working.

Could you flash it? I only thought the MFA05 worked. I’ve got a few, but have yet to flash them

Yep, got it working. It would appear some of the settings don’t do anything, and I can’t get the motion switch to only turn on when dark (althought I didn’t test that on the Tuya firmware either).

To flash with ltchiptool:
Connect GND to RST, GND and CEN
Connect TX to RX, RX to TX
Connect 3.3v to 3.3.v

You might need to touch CEN to GND and hold it or just touch it once after it boots.

Use this as a template (you can download it locally and customize):

substitutions:
  devicename: milfra-mfa05f-switch1
  friendlyname: Motion Switch 1
  modelname: Milfra MFA05F
  update_interval_wifi: "60s"
  baud_rate: "9600"

packages:
  remote_package:
    url: https://github.com/rwalker777/HA-Blueprints
    ref: main
    refresh: 300s
    files:
      - Milfra-MFA05F.yaml

Thanks. I have a number of the old version but none of the one’s that use Tuya. How did you find what functions the data points did? Am concerned about flashing these and not have a workable switch. From what I can tell, without have correct code the switch doesn’t even work. Not like the old ones where a button was wired to activate the relay. Is this what you are finding?

5310h

Someone from the OpenBeken project scraped the info from the Tuya API. The manual button works without issues. The PIR sensor works with my YAML without changing any settings. You can customize after that. They are solid for me now.

1 Like

Thanks for the update. For now, I think I’ll stay with “Local Tuya”. Which I saw was going to be integrated into HA Core. Very easy to setup and works without any cloud connection.

Thanks, I’ll play with it. I have 3 MFA05F’s, turns out the seller mislabled them as the MFA05