HKWL-MS03W motion sensor with Tasmota

That is exactly what I did! Went to Kmart, bought 2 news ones, when back the next day and returned the damaged ones in the new packaging. And I kept the extra batterys :slight_smile: :sweat_smile:

I will edit my posts so this mistake is not made again. The older tuya convert wouldn’t flash, but the newest did without a hitch. Just let it sit whilst flashing, even if you see an error exception line :ok_hand:

I have not used Tuya Convert before, are you able to provide a link to the github page you used with the latest version?

It was updated since when I first tried back in November.

1 Like

That was the exact method I used. If you can accomplish it with Tuya Convert, without opening then there is most definitely less chances of screwing it up. I also have a FTDI adapter, but have not needed to use it for these specific ones. If you are planning USB connected state then the response WAAAY better than on batteries, so that would be my recommendation.
@ Petrica Thanks for the Zigbee suggestion. Fortunately I already have around 20 or so RF sensors as they are part of my Home alarm, so that will be a good experiment to see what I can get done with those ones. I will also give the zigbee ones a go for the experience.

I also use smartthings sensors from JB Hi-fi with a cheep Ziggbee USB from online it works great. So glad I don’t need expensive hubs but can use well known brands. I haven’t put my tasmoted sensors up yet so I can’t say what performs better.
But ST sensor @ JB $27.20
Mirabella @ Kmart $29
And cheeper smaller batterys with ST.
I guess it comes down to the batteries, what cost more per year… but Mirabella has wired option… hard to say what’s better…no wifi traffic on ST, but need a ZigBee USB, but it could pay for itself… I could split so many hairs haha

I am unable to get the new device to flash via Tuya Convert, any specific way to get it into flash mode?

Update:
Scratch that, I believe my ss and OpenSSL is out of date causing the flash not to work. I need to find a way to update these, I am on Ubuntu 16.04.

Update 2:
I have updated to Ubuntu 19.04 on my vm and was able to successfully flash Tasmota. I will attempt the template now.

Final:
Its working, with the new device I can now see the command data for the sensor.
It is spamming the command quite a lot even though there is no movement. Ill have to test is more once I have it interfacing with home assistant. Time to send back the dead one and get a new one :wink:

Nice ! I had to keep triggering the sensor during the Tuya-convert flash, otherwise the percentage would freeze and not complete. Good luck at the shop, the girl didn’t even ask questions, I just said “I thought they were little motion lights for cupboards” hahaha

Also sorry I broke your first sensor…

Its all part of the learning process!
Glad to have it up and running!

Thanks for all the hard work! I seem to have my Tuya sensor working using this method.The concole shows motion and sends the mqtt message. But I am new to MQTT. How do I set up the sensor in HA? I know I need to add something to my config, but I am ubsure what to add. Could anyone point me in the right direction?
Thanks

Here is some information to get you going!:

Payload on/off would be whatever you set in your Rule1
Device Class would be motion.

I will post my config later if I remeber, and you are still having issues!

I have this working now while it is connected to USB power, can’t seem to get this to function when running from the battery. Here is my Tasmota specific configuration

Rules

Rule1 ON TuyaReceived#Data=55AA0005000A65010001016601000100DE DO publish OfficePir/tele/PirSensor Sensor_triggered ENDON ON TuyaReceived#Data=55AA0005000A65010001006601000100DD DO publish OfficePir/tele/PirSensor Sensor_Triggered_Cleared ENDON

Rule2 ON TuyaReceived#Data=55AA0005000F6501000100660100010068010001014D DO publish OfficePir/tele/PirSensor Tamper_Triggered ENDON

Configuration.yaml

binary_sensor:

  • platform: mqtt
    name: “Office Motion Sensor”
    state_topic: “OfficePir/tele/PirSensor”
    payload_on: “Sensor_triggered”
    payload_off: “Sensor_Triggered_Cleared”
    device_class: motion

Have also configured

SetOption19 1
SetOption66 1
TuyaMCU 11,8
TuyaMCU 51,20

Template

{“NAME”:“GenioPir”,“GPIO”:[17,107,0,108,0,0,0,0,0,56,0,0,0],“FLAG”:0,“BASE”:54}

Thanks for your work on this. I am getting an error when checking configuration of my system after adding to the configuration.yaml file.

"Invalid config for [binary_sensor.mqtt]: required key not provided @ data[‘state_topic’]. Got None. (See ?, line ?). "

I am a newbee so any assistance would be appreciated.

Can you post your configuration?
We can have a look at it for you and see what you missed.

The configuration is a copy of yours, viz

binary_sensor:

  • platform: mqtt
  • name: “Office Motion Sensor”
  • state_topic: “OfficePir/tele/PirSensor”
  • payload_on: “Sensor_triggered”
  • payload_off: “Sensor_triggered_Cleared”
  • device_class: motion
    I have used single quotes as well on my first attempt but same error. The name of the device matches. I have loaded the 'triggers’and other adjustments as outlined in the guide. state_topic I assume refers to a file. I do not have this. Could this be the issue.
    Appreciate you helping me on this.

Can anybody assist me with my issue here?

Read this topic :
https://community.home-assistant.io/t/how-to-help-us-help-you-or-how-to-ask-a-good-question/114371/4

and post your configuration the correct way. Nobody can help the way you posted now.

Thanks…sorry about that incorrect post. I’ll read up on how to post correctly and re-submit.

F

remove all the quotes. (")
then add them back in. For some reason copying and pasting causes the quotes to be formated differently.

Hi,

First time caller long time listener, (my first post the Home Assist forum).
I’ve regularly followed conversations here as there seems to be a lot of Australian discussion about smart products available in Australia.

I’ve recently starting play around with the Mirabella HKWL-MS03W and @jssting 's development really helped me along.

But after reading up a pages about Tasmota and TuyaMCU https://tasmota.github.io/docs/TuyaMCU/ I have made a few more developments with the tuyamcu command.
My current setting are:

TuyaMCU 11,1
TuyaMCU 1,101
TuyaMCU 51,20

Setting TuyaMCU 1,101 sets the Tasmota switch status directly to the motion detector.
With MQTT enabled and setup, Tasmota will naturally report it’s status without the use of rules by reporting:
stat/pir/POWER = ON

When connected to USB it will also report:
stat/pir/POWER = OFF

With weblog 4 enabled, in Tasmota console reports the use of dpID 102. (we are using dpID 101 as the motion sensor. On battery, dpID 103 and 104 are also reported.

If we can work out what the dpIDs are and map them correctly to the right fnID we might be able to get the motion sensor working natively with Tasmota without the need for rules.

Cheers,

Jamie

1 Like

Nice work Mate!