Esp + mqtt + rule

Hi There,

I have some ESP Wall switches and configured some rules. But want activate them using MQTT
Now I have some shell_commands to do this:

meek_fan_turn_off: 'curl http://192.168.100.113/control?cmd=event,FanOff'
meek_fan_turn_on: 'curl http://192.168.100.113/control?cmd=event,FanOn'

Is it possible to change this into a MQTT Action?

The rule in ESP:

on FanOn do
     TaskValueSet 6,4,0
endon

on FanOff do
     TaskValueSet 6,4,1
endon

If it is possible to turn Tast 6,4 from 0 to 1 and vs using MQTT also than I can remove the rule in ESP

ESP info

Name of ESP Easy Mega: MeekWC

Thanks!!